Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery mobile jquerymobile url参数_Jquery Mobile_Parameters_Cordova - Fatal编程技术网

Jquery mobile jquerymobile url参数

Jquery mobile jquerymobile url参数,jquery-mobile,parameters,cordova,Jquery Mobile,Parameters,Cordova,我问了两个问题却没有得到答案,花了几个小时试图找到答案却没有成功,我想知道是否有人能最终帮助我 我需要在jquerymobile上生成动态URL和传递参数 例如 <a href="menu.php?id=2">Menu 2</a> <a href="results.php?id=4">Result No. 4</a> 上面的URL需要是动态的,我需要能够通过一个ID参数 然后我需要获取给定页面上的id参数 我已经阅读了很多关于changePa

我问了两个问题却没有得到答案,花了几个小时试图找到答案却没有成功,我想知道是否有人能最终帮助我

我需要在jquerymobile上生成动态URL和传递参数

例如

<a href="menu.php?id=2">Menu 2</a>
<a href="results.php?id=4">Result No. 4</a>

上面的URL需要是动态的,我需要能够通过一个ID参数

然后我需要获取给定页面上的id参数

我已经阅读了很多关于changePage等的内容,但我可以在函数中指定下一个页面,因为它需要是动态的。我还需要ajax转换才能工作,因此ajax false必须为true

请一劳永逸地帮助我,并为我提供示例代码


亲切的问候

好的,要在导航的页面上获取url参数,请使用类似于以下内容的内容

它使用pageshow事件从当前URL获取ID

我使用了这个问题答案中的函数-:


如果上面的正则表达式不起作用,则表示尝试此更改

function getURLParameter(name) {
return decodeURI(
    (RegExp(name + '=' + '(.+?)(&|$)').exec(window.location.href)||[,null])[1]
);

}

因此,您希望从A页(有些链接与您发布的链接类似)导航到B页,在B页中,您希望能够获取URL中的ID?不确定您是否仍在寻找解决方案,但我为thisBrill创建了一个解决方案,我将尝试,显然我已经考虑过了!
function getURLParameter(name) {
return decodeURI(
    (RegExp(name + '=' + '(.+?)(&|$)').exec(window.location.href)||[,null])[1]
);