Working with iframe history

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • musicmaster890
    New Member
    • Apr 2008
    • 11

    Working with iframe history

    Hi everybody!

    I'm using iframes in my most recent WebDev project called "Felix" and would like to know how I can use Javascript to make a back button for the iframe. Here's the code I have:

    Code:
    <input type="button" style="width:64px" onclick="javascript:document.getElementById('pHubiframe_resource').history.go(-1)" value="&larr;Back" />
    When I use that code, I get a JScript error that pHubiframe_reso urce doesn't support the history.go function, if I remember correctly. Thanks in advance.
  • musicmaster890
    New Member
    • Apr 2008
    • 11

    #2
    UPDATE:

    I've changed it to just

    Code:
    ...onclick="javascript:history.go(-1)"...
    and it works, but it opens up the possibility for my entire page to go back to a completely different page all together. Is there a way to make it so that the button becomes disabled when the first page (which is "about:blan k", but it doesn't index : / )?

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      If you give your frames a name and access them using frames[frameName], you could call history.back() on them.

      Comment

      Working...