Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/81.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
Javascript 在url中查找hashtag并使用php附加到该url中的最后一个_Javascript_Jquery_Url - Fatal编程技术网

Javascript 在url中查找hashtag并使用php附加到该url中的最后一个

Javascript 在url中查找hashtag并使用php附加到该url中的最后一个,javascript,jquery,url,Javascript,Jquery,Url,我需要一个解决方案,在url中找到标签,并使用php附加到该url中的最后一个 旧URL: <a href="http://www.example.com#anchor1?name=shreyas&city=surat">My Url</a> 新网址: <a href="http://www.example.com#anchor1?name=shreyas&city=surat">My Url</a> 您也可以试试这个 HTML

我需要一个解决方案,在url中找到标签,并使用php附加到该url中的最后一个

旧URL:

<a href="http://www.example.com#anchor1?name=shreyas&city=surat">My Url</a>
新网址:

<a href="http://www.example.com#anchor1?name=shreyas&city=surat">My Url</a>
您也可以试试这个

HTML:

<a href="http://www.example.com#anchor1?name=shreyas&city=surat">My Url</a>

window.location.search=window.location.search+window.location.hash
@adeneo
window.location.hash
也将包含查询字符串。