我有一个页面里边是链接的列表比如<a href="index.php?id=1#post">,当点击这个链接的时候,我怎么在新的页面获取到到id=1,然后去服务器请求内容。
我有一个页面里边是链接的列表比如<a href="index.php?id=1#post">,当点击这个链接的时候,我怎么在新的页面获取到到id=1,然后去服务器请求内容。
|
airylandJun 9, 2015
1
在新的页面从location.href取得id。
|
|
WangxfJun 9, 2015 via iPhone
2
location.href获得,然后split之类的去做处理取到
|
|
SeptembersJun 9, 2015
3
> location.search
< "?id=1" > location.search.slice(1) < "id=1" |
|
desJun 9, 2015
5
不知道题主想说什么?我试了是可以的
http://img-storage.qiniudn.com/15-6-9/15170212.jpg |
|
gilgameshJun 9, 2015 via Android
7
你不想跳转的话就别用 a(href) 呗。
|
|
8
|