back button history handling for iframe with jquery (IE failed me again)
<script src=js/jquery/1.3.2.js></script>
<script src=js/jquery/timers.js></script>
<a name=n1 url=http://g.cn />
<a name=n2 url=http://sohu.com />
<a name=n3 url=http://pcpop.com />
<a href=#n1>g.cn</a>
<a href=#n2>sohu.com</a>
<a href=#n3>pcpop.com</a>
<hr/>
<iframe name=iframe width=1280 height=1024></iframe>
<script>
var cm = {hash: ''}
$(document).everyTime(100, function(){
var hash = location.hash
if(hash && cm.hash != hash){
cm.hash = hash
frames.iframe.location.replace($('a[name='+hash.slice(1)+']').attr('url'))
}
})
</script>
Doesn't work in IE...>_<
Turns out there are plugins for this already...[url=http://www.mikage.to/jquery/jquery_history.html]jQuery history[/url] [url=http://www.asual.com/jquery/address/]jQuery Address[/url] [url=http://benalman.com/projects/jquery-bbq-plugin]jQuery BBQ[/url]
相關文章
- history.back()
- history.back(-1)和history.go(-1)區別Go
- JQuery iframe頁面jQuery
- would dispatch back to the current handler URL [/doLogin] again. Check your ViewResolver setup!AIView
- iframe的操作-Js/Jquery獲取iframe中的元素JSjQuery
- HTML5中History.back()頁面後退重新整理頁面HTML
- 解析Jquery取得iframe中元素的幾種方法jQuery
- SAP UI5 的路由歷史和路由回退(Routing back and history)試讀版UI路由
- 『杭電1848』Fibonacci again and againAI
- jQuery操作iframe中js函式的方法小結jQueryJS函式
- IE 相容模式 設定 Meta Compatible 和 Iframe 子頁面的關係模式
- [Bash] Error handlingError
- Jquery中獲取iframe的程式碼(window.top.parent)jQuery
- HDU 1848 Fibonacci again and again(SG函式)AI函式
- 偏前端 – jquery-iframe內觸發父視窗自定義事件-前端jQuery事件
- Decade counter againAI
- Multi-path handling for asmASM
- Netty series: handling CORS in nettyNettyCORS
- HDU 1848 Fibonacci again and again (尼姆博弈+sg函式)AI函式
- 物件不支援“addEventListener”屬性或方法 ie8 jquery物件devjQuery
- If I were a boy againAI
- Trees and XOR Queries AgainAI
- Mergesort Strikes Back
- 回溯(Back Tracking)
- Handling duplicate form submission in Spring MVCORMSpringMVC
- [Typescript] Handling a Truly Empty Object in TypeScriptTypeScriptObject
- ie中jQuery無法解析xml檔案的解決方案jQueryXML
- Button
- Javascript history物件的 history.pushState() 和 history.replaceState() 方法JavaScript物件
- READ ME
- about me
- jquery獲取低程式碼平臺iframe巢狀的父級元素指定元素jQuery巢狀
- [Vue Router] Error Handling and 404sVueError
- <button>和<input type=“button“> 的區別
- The Red Button
- jquery1.9以上版本判斷瀏覽器是否為IE6jQuery瀏覽器
- history物件物件
- AP History
- recently----me