如何在链接中使用Js函数的参数 [英] How Do I Use Js Function's Parameter In Link
本文介绍了如何在链接中使用Js函数的参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想做的是在打开其他jsp时将我的js函数的参数传递给链接。
这是代码:
What i would like to do is to pass my js function's parameter to link when opening other jsp.
Here's the code:
function openDialog(myVariable){
$('div#dialogbox').dialog({
buttons:{
'OK': function(){
window.location.href="otherfile.jsp?id= '; //I want myVariable value after "id="
}}});
}
推荐答案
(' div#dialogbox')。dialog({
buttons:{
' OK': function (){
window 。 location .href = otherfile.jsp?id ='; //在 id =
}}})之后,我想要myVariable值;
}
('div#dialogbox').dialog({ buttons:{ 'OK': function(){ window.location.href="otherfile.jsp?id= '; //I want myVariable value after "id=" }}}); }
更改代码
Change the code from
function openDialog(myVariable){
(' div#dialogbox')。dialog({
buttons:{
' OK': function (){
窗口。 location .href = otherfile .jsp?id ='; //我希望myVariable值在 id =
之后};});
}
('div#dialogbox').dialog({ buttons:{ 'OK': function(){ window.location.href="otherfile.jsp?id= '; //I want myVariable value after "id=" }}}); }
到
To
function openDialog(myVariable){
这篇关于如何在链接中使用Js函数的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文