Open.window in iframe

Unknown picture Unknown · Dec 31, 2012 · Viewed 82.9k times · Source

I am making a simple webpage for fun and I am a noob at JavaScript and I want to make windows open up when clicked and I want to open them up inside an iframe and I want to give it all the functionality of a normal window.open and I also want it to maximize the windows but inside the iframe and not outside. I know About the window.open and go it to work I just want to make the windows work inside an iframe and not outside. I am using Notepad for as my editor. This is my first question so please forgive me if I made any mistakes thanks.

Answer

Praveen Kumar Purushothaman picture Praveen Kumar Purushothaman · Dec 31, 2012

If you want to open a window within an iframe:

  1. Create the iframe with a name.

     <iframe name="theFrame"></iframe>
    
  2. Now use the script this way:

     window.open(url, "theFrame");