Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2012
    Posts
    13
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Use javascript to open iframe links in new window?

    For my brand's site, I want to embed our ecommerce page (from Bootic.com) into my WordPress site's product pages. I'm attempting to do this with iframes. For links within the iframe, I want them to open up in a new window/tab.

    Now, since the iframe source is on a different domain, I have no access to the HTML. Is it possible to accomplish this using javascript?

    Additionally, I'm looking at the option of using a lightbox overlay rather than an iframe embed. Same question here -- can I use javascript for links on the lightbox to open up in a new window/tab?

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,471
    Thanks
    0
    Thanked 634 Times in 624 Posts
    Quote Originally Posted by bswb97 View Post
    Now, since the iframe source is on a different domain, I have no access to the HTML. Is it possible to accomplish this using javascript?
    Now, since the iframe source is on a different domain, you have no access to interact with it using JavaScript.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #3
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,184
    Thanks
    10
    Thanked 569 Times in 550 Posts
    Code:
    <iframe seamless>
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/1/19) IE7:0.2, IE8:6.7, IE11:7.4, IE9:3.8, IE10:4.4, FF:18.3, CH:43.6, SF:7.8, MOBILE:27.5


  •  

    Tags for this Thread

    Posting Permissions

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