如何添加javascript location.href [英] how to add javascript location.href

查看:75
本文介绍了如何添加javascript location.href的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我需要现在当我有一个按钮&我需要将3个参数发送到其他页面我使用位置.href但是不工作这是我的代码请帮助我



< script>



function btnExternalPayGhest_Click(id){



if (id == 190){



location.href ='http://www.tkhkportal.com/Login.aspx?ReturnUrl=default.aspx?x= '+ GhestCompanyID +'&y ='+ ExternalGhestID +'&y ='+ ExternalCellPhone;



}



否则if(id == 240){



location.href ='http://www.tkhkportal.com/Login.aspx?ReturnUrl=default.aspx ?x ='+ GhestCompanyID +'&y ='+ ExternalGhestID +'&y ='+ ExternalCellPhone;



}



}

< / script>

< form name =form1>



< input type =buttonname =بررسیvalue =بررسی>



< / form>

hi i need to now when i have one button & i need to send 3 parameters to other page i use location .href but don't work this is my code please help me

<script >

function btnExternalPayGhest_Click(id) {

if (id == 190) {

location.href = 'http://www.tkhkportal.com/Login.aspx?ReturnUrl=default.aspx?x=' + GhestCompanyID +'&y='+ExternalGhestID +'&y=' +ExternalCellPhone;

}

else if (id == 240) {

location.href = 'http://www.tkhkportal.com/Login.aspx?ReturnUrl=default.aspx?x=' + GhestCompanyID + '&y=' + ExternalGhestID + '&y=' + ExternalCellPhone;

}

}
</script>
<form name="form1">

<input type="button" name="بررسی" value="بررسی" >

</form>

推荐答案

我仍然不确定你的问题,但如果我要发送来自一页的3个值,这就是我要做的,



I am still not sure about your question, But If I was to send 3 values from one page , This is what I would have done,

<form id="form1" runat="server">
 <div>
     <input type="text" id="GhestCompanyID" value="GhestCompanyID" />
     <input type="text" id="ExternalGhestID" value="ExternalGhestID" />
     <input type="text" id="ExternalCellPhone" value="ExternalCellPhone" />
     <input type="button" name="aaaa" value="bbbb" onclick="btnExternalPayGhest_Click(190)" />
 </div>
 </form>





和写脚本一样,





and write script like,

function btnExternalPayGhest_Click(id) {
     var GhestCompanyID = document.getElementById("GhestCompanyID").value;
     var ExternalGhestID = document.getElementById("ExternalGhestID").value;
     var ExternalCellPhone = document.getElementById("ExternalCellPhone").value;
     if (id== 190) {

         location.href = 'http://www.tkhkportal.com/Login.aspx?ReturnUrl=default.aspx?x=' + GhestCompanyID + '&y=' + ExternalGhestID + '&z=' + ExternalCellPhone;

         }

     else if (GhestCompanyID == 240) {

     location.href = 'http://www.tkhkportal.com/Login.aspx?ReturnUrl=default.aspx?x=' + GhestCompanyID + '&y=' + ExternalGhestID + '&z=' + ExternalCellPhone;

 }
}


这篇关于如何添加javascript location.href的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆