[英]Open URL from button Dashcode
I am sure that this is extremely easy and probably a one liner but I can't seem to find the answer anywhere. 我敢肯定,这非常容易,可能只有一个班轮,但我似乎找不到任何答案。
I am creating a very simple web app in Dashcode (my first time) that has a button, when you press it, it needs to link to a url. 我正在Dashcode中创建一个非常简单的Web应用程序(我第一次),该应用程序有一个按钮,当您按下它时,它需要链接到URL。
Cannot seem to find anything. 似乎找不到任何东西。
Thank you very much for your time. 非常感谢您的宝贵时间。
I relied on Apple Developer for this: 为此,我依靠Apple Developer :
function yourHandler(event) {
widget.openURL("http://store.apple.com/");
}
Try this... First add button event onclick (openURL) Then code follows... 试试这个...首先添加按钮事件onclick(openURL),然后执行代码...
function openURL()
{
if ( window.widget )
{
widget.openURL( “http://www.google.com” );
return false;
}
}
Or Try... 或尝试...
{
widget.openURL('http://www.google.com');
}
Try this too 也尝试一下
function myButtonPressHandler(event)
{
var websiteURL = "http://www.google.com";
location = websiteURL;
}
最终这就是我需要的:
document.location = ("http://www.google.com");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.