javascript - IFRAME and back / forward button -


i working on simple .hta application has control pane , iframe.

i have added , forward button, not appear work. if links "a" , "b" in following example clicked, , forward buttons not anything.

how can achieved?

test.hta =================================== <!doctype html> <html> <head>     <title>back / forward buttons</title>     <hta:application id="test" applicationname="test" icon="res/icon.ico" showintaskbar="yes" singleinstance="yes"> </head> <body>     <div class="strip">         <button onclick="output.history.back(); return false">back</button>         <button onclick="output.history.forward(); return false">forward</button>     </div>      <div id="iframe-wrap" class="iframe-container">         <iframe id="output" name="output" src="a.html" width="100%" border="0" frameborder="no" scrolling="yes"></iframe>     </div> </body> </html>  a.html =================================== <!doctype html> <html>     <head><title>a</title></head>     <body>page - <a href="b.html">go b</a></body> </html>  b.html =================================== <!doctype html> <html>     <head><title>b</title></head>     <body>page b - <a href="a.html">go a</a></body> </html> 

try:

window.frames.output.history.forward(); 

or

window.frames.output.history.go(+1); 

probably better use getelementbyid element trying use history on.

there known cross browser issues history on iframe's can't remember @ moment, google should able answer you.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -