作者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