www.webdeveloper.com
Results 1 to 3 of 3

Thread: Iframe and opening a new window

  1. #1
    Join Date
    Apr 2006
    Location
    South Africa - Cape Town
    Posts
    3

    Iframe and opening a new window

    Hi

    I have an iframe the gets fed from elsewhere (for this problem-http://www.google.com). The problem is clicking on the link in the iframe.
    The relevant webpage is then opened in the iframe itself whereas i want it to open in a new window.

    The code looks like this
    //Start of code

    <iframe
    src=http://www.google.com
    width="120" height="140"
    scrolling="no"
    frameborder="0"
    target=_blank
    name="content">
    </iframe>

    //end of code

    What do i need to add to make anything that I click on in the iframe opens up in a new window?

    Thanks in advance
    SoulBlade

  2. #2
    Join Date
    Apr 2005
    Location
    Hastings, Sussex, UK.
    Posts
    244
    You'd need to set the target for the links within the iframe to _blank. If this is not possible due to not having control over the iframe content then you'll need some nifty DOM scripting to achieve the result. There's loads of examples of this so give Google a whizz or pop over to the JavaScript forum.

  3. #3
    Join Date
    Apr 2006
    Location
    South Africa - Cape Town
    Posts
    3
    Hey Eddie

    Yep, your right. I don't have any control over the iframe content. I have tried target=_blank but to no avail. Is there perhaps another method to it?

    SoulBlade

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles