【发布时间】:2014-06-06 11:38:47
【问题描述】:
我想将选定的 列表项 的值传递到另一个页面,这意味着如果我从列表中选择 abc,那么这个 abc 值将传递到下一个 html 表单,它应该打开该配置文件仅页面。有什么方法可以在不同的 html 页面中使用此变量。
$('.ui-li-icon li').click(function() {
var index = $(this).index();
text = $(this).text();
alert('Index is: ' + index + ' and text is ' + text);
我想将上述文本值传递给具有 javascript 函数 profile() 的 profile.html。所以我想在函数调用中传递此文本,例如profile(text);我尝试在函数调用上方声明 var text 但仍然无法正常工作。请告诉我是否有其他方法。
【问题讨论】:
-
你在哪里使用 profile(text) ??
-
在另一个 profile.html 中我已经包含了这个 profile.js 并且在 profile.js 中它包含函数 profile(text){};
标签: javascript jquery html