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 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思