javascript - Controlling back/forward navigation of a *child* iframe? -


I'm working on a simple JavaScript-based window "app" (not a website, just some HTML and JS files All in the same folder which will be used on the local PC).

The startup page is page 1. This page has 2 buttons ("back" and "forward"), and is an iframe that displays the content of page 2.html. And Page2.html also contains an IFAM, which displays many other pages in the same folder (we call it "color" page -> red-hm, green, hm, blue html etc.).

In other words, when Page1.html has been started, you are viewing the contents of an iframe inside the iframe (which will be red.html, etc.).

So I need to complete this ...

I have to use the rear / back buttons to navigate to the "Page" page. Html).

I have found that it is easy to navigate / navigate / iframe which is in the form of JS on same page , which is controlling iframe, like Using something ..

  $ (document) .ready (function () {$ ("# back_button_on_page1"). Masudown (function () {document.getElementById ("iframe_on_page1"). ContentWindow.history.back ( );}); $ ("#forward_button_on_page1"). Masudown (function () {document.getElementById ("iframe_on_page1"). ContentWindow.history.forward ();});});  

etc.

But it is not what I want. What do I need to do to control IF IMEs as on another page (and how to not explain it)

  $ (document) $ ("#back_button_on_page1 "). Musudown (function () {document.getElementById ("iframe_on_page2"). Content Window.history.back ();}); $ ("# Forward_button_on_page1") (Function () {document.getElementById ("iframe_on_page2"). ContentWindow.history.forward ();});});  

I have put JS above the same file (men.js), and then the file was told from both pages 1.html and page 2.html (later i JQuery Libory included in each page, of course). But it does not work

So ... does anyone know how to accomplish this?

BTW- If it makes a difference, the solution needs to work only in Chrome.

Thank you!


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -