可能重复:
如何获取查询字符串值?
我有以下网址:
http://www.mysite.co.uk/?location=mylocation1
Run Code Online (Sandbox Code Playgroud)
我需要的是location从URL 获取变量的值,然后在jQuery代码中使用它:
var thequerystring = "getthequerystringhere"
$('html,body').animate({scrollTop: $("div#" + thequerystring).offset().top}, 500);
Run Code Online (Sandbox Code Playgroud)
有谁知道如何使用JavaScript或jQuery获取该值?
我有两页jQuery,Page1和Page2,我可以在Page1中获得输入.
的somval=1000$.
第1页用户输入somevalue.我存储了值:
var val = somval;
Run Code Online (Sandbox Code Playgroud)
现在在第二页中,我需要在第1页中获得somvalue的结果.当然,分别使用My1.js My2.js的两个页面.
如何将一个jQuery文件中的值与其他JavaScript共享,或者如何从page1值获取值到page2?
我该如何解决这个问题?