小编use*_*421的帖子

如何在javascript中的不同html页面之间传递变量值

我想将所选列表项的值传递给另一页,这意味着如果我从列表中选择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);
Run Code Online (Sandbox Code Playgroud)

我想将上面的文本值传递给我的profile.html,它有javascript函数profile().所以我想在函数调用中传递这个文本,如profile(text);我尝试在函数调用上面声明var text但仍然是不工作.请告诉我是否有其他方式.

html javascript jquery

8
推荐指数
3
解决办法
4万
查看次数

标签 统计

html ×1

javascript ×1

jquery ×1