[問題] jquery history plugin
這是我看到的 jquery history plugin 網址:
http://www.mikage.to/jquery/jquery_history.html
關於 ajax 和back button, 不知道是不是有網友也使用這個 plugin
我剛剛有試了一下這個 plugin,我的測試網址:
http://test.guchi.com.tw/jquery_history/test01.html
當我按 add history 1 時,網址會加上 #page1
當我按 add history 2 時,網址會加上 #page2
而且按下這兩個連結的同時,都會透過 $.getJSON 去 request test01.php
並將內容 append 到 div#resultDiv 裡
test01.php 內容:
<?php
echo(json_encode(date('Y-m-d H:i:s')));
?>
我按了 add history 1 這個link後, div#resultDiv 有增加內容 OK
然後我直接按回 browser 的上一頁按鈕,這時我發現 div#resultDiv 又有新內容
我以為按了回上一頁,會是直接顯示上一頁的 cache
但看樣子它的操作是每次都執行我餵給它的 javascript function (此指 ajaxRender)
我覺得回back 或 forward 應該是要直接顯示cache內容好像比較合理吧?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.132.186.59
→
12/12 14:46, , 1F
12/12 14:46, 1F
→
12/12 14:46, , 2F
12/12 14:46, 2F
→
12/12 14:47, , 3F
12/12 14:47, 3F
推
12/12 18:05, , 4F
12/12 18:05, 4F
→
12/12 18:06, , 5F
12/12 18:06, 5F
→
12/12 18:07, , 6F
12/12 18:07, 6F
討論串 (同標題文章)
完整討論串 (本文為第 1 之 2 篇):
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章