简体   繁体   English

如何在多页 html 文档中传递查询字符串

[英]how to pass query string in a multipage html document

I have html document with 2 pages and am using html5, jquery and jquery mobile.我有 2 页的 html 文档,正在使用 html5、jquery 和 jquery mobile。 I need to pass a value from onepage to another page.我需要将一个值从一个页面传递到另一个页面。 I am using url like test.html#page-b.我正在使用像 test.html#page-b 这样的 url。 How to pass query string through this url如何通过此 url 传递查询字符串

You could do something like below:您可以执行以下操作:

     $(window).load(function() {
      window.location.href =  window.location.href?qs=XXX
    });

您需要在 URL 中的哈希之前有查询字符串。

test.html?query=string#hash

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM