dongmeirang4679 2013-03-06 18:39
浏览 101

如何使用jquery mobile和ajax实现浏览器历史记录和书签

I am trying to build a site with JQM, JQuery, PHP and MYSQL. The idea is to use ajax to pull information from the database (JSON) to insert it on the page. My only issue is that I am not sure how to implement the ajax in a way that makes it easy to bookmark pages and go back (to the last page) on the JQM site. I was thinking to use pushstate but am not sure on how to implement it. Can anyone point me to a tutorial on how to do this effectively or if they can put up some example code.

  • 写回答

1条回答

  • dongzhi5386 2013-03-07 09:33
    关注

    Save it in the page url, so lets so your page URL is: test_page.php and json URL is test_json.php. You want to bookmark the page for all with the name "mark". So you bookmark test_page.php?name=mark. Then on page load you define it to your json to get all for mark.

    This way you can bookmark the URL and just fetch according to the parameters in the URL.

    评论

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘