colorsand
V2EX  ›  jQuery

jqm 怎么传值?

  •  
  •   colorsand · Jun 8, 2015 · 3238 views
    This topic created in 4027 days ago, the information mentioned may be changed or developed.

    我有一个页面里边是链接的列表比如<a href="index.php?id=1#post">,当点击这个链接的时候,我怎么在新的页面获取到到id=1,然后去服务器请求内容。

    8 replies    2015-06-09 14:19:56 +08:00
    airyland
        1
    airyland  
       Jun 9, 2015
    在新的页面从location.href取得id。
    Wangxf
        2
    Wangxf  
       Jun 9, 2015 via iPhone
    location.href获得,然后split之类的去做处理取到
    Septembers
        3
    Septembers  
       Jun 9, 2015
    > location.search
    < "?id=1"
    > location.search.slice(1)
    < "id=1"
    colorsand
        4
    colorsand  
    OP
       Jun 9, 2015
    @airyland 新页面里边的url变成了index.php?#post,没有id=1
    des
        5
    des  
       Jun 9, 2015
    不知道题主想说什么?我试了是可以的
    http://img-storage.qiniudn.com/15-6-9/15170212.jpg
    airyland
        6
    airyland  
       Jun 9, 2015
    @colorsand 额,你问题描述相当不准确。
    gilgamesh
        7
    gilgamesh  
       Jun 9, 2015 via Android
    你不想跳转的话就别用 a(href) 呗。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4236 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 67ms · UTC 10:02 · PVG 18:02 · LAX 03:02 · JFK 06:02
    ♥ Do have faith in what you're doing.