作者TonyQ (沉默是金)
看板Ajax
標題Re: [問題] hash 要如何被ie記錄?
時間Sat Aug 30 16:22:59 2008
※ 引述《KiroKu ()》之銘言:
: 如題,
: 當利用location.href=lct+"#"+page_id;//lct 是處理過的網址
: fx 可以去把它記成一頁,方便坐上一頁的處理
: 在ie卻不行?有沒有可以讓ie記下的方法?
用iframe 的href作hash...
這是jquery.history plug-in中的程式碼片段 , 可以參考一下iframe的部份.
(ihistory是頁面預先作好的iframe物件 , 其他的部份都可以用純js實做.
newhash是希望要記錄的hash.
if(jQuery.browser.msie) {
var ihistory = $("
#jQuery_history")[0];
var iframe = ihistory.contentWindow.document;
iframe.open();
iframe.close();
iframe.location.hash = newhash;
}
--
What do you want to have ? / What do you have?
從書本中,你可以發現我的各種興趣。
從CD中,你可以瞭解我所喜歡的偶像明星。
或許從文字你很難以瞭解一個人,但從物品可以。
My PPolis , My past. http://ppolis.tw/user/Tony
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.104.40.10
1F:推 KiroKu:不太了解這段程式碼的意思耶..如果我按上一頁是iframe會倒 08/30 21:12
2F:→ KiroKu:回去 還是視窗網址會倒回去? 08/30 21:12
3F:→ TonyQ:網址會倒回去~ 08/30 21:46
4F:→ TonyQ:他只是利用ie6會紀錄iframe的hash來作上下一頁的紀錄而已 08/30 21:48