我必須從href鏈接中拆分值。使用jquery從href鏈接中獲取值
我的HREF鏈接如下
var val =location.href // outputs http://localhost:8080/[email protected]&joid=68
我想單獨獲得username
價值和joid
價值。
我試着以下但不工作
var emailrogh= val.split("&");
email=emailrogh[0];
var idrough=emailrogh[1].split("=");
var id=idrough[1];
我怎麼能提取[email protected]
和68
http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values –