如何将URL作为参数传递给javascript函数 [英] How to pass URL as parameter to the javascript function
本文介绍了如何将URL作为参数传递给javascript函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我点击按钮时我实现了javascript和一个按钮我希望将UR作为参数传递给该函数
我尝试了什么:
I implemented javascript and one button when I click the button I want to pass UR as parameter to that function
What I have tried:
function <pre><pre lang="text"><script type="text/javascript">
function LoadHGGames(param) {
var url = param;
window.open(url, 'winPop', '_blank,height=650,width=1000,left=0,top=0,resizable=yes,location=yes,status=no');
window.focus();
return false;
}
</script>
<asp:Button runat="server" Text="submit" OnClientClick="javascipt:LoadHGGames(https://v3livehguat.hointeractive.com/visitor/login/V3login.jsp?detectflash=false&lang=en&refreshfly=true)" />
此代码无效
推荐答案
在网址中添加引号
add quotes to the url
<asp:Button runat="server" Text="submit" OnClientClick="javascipt:LoadHGGames('https://v3livehguat.hointeractive.com/visitor/login/V3login.jsp?detectflash=false&lang=en&refreshfly=true')" />
这篇关于如何将URL作为参数传递给javascript函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文