SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jul 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Replace / change links within iframes

    Hi,

    I've got an iframe on my page that displays my affiliate's webpages (located on their domain).

    Two concerns:

    First, all links within the iframe reveal their domain name in the status bar and in the page source, i.e. <a href="affiliate.com/buy.htm">.

    Second, the links in the iframe have target="_blank" which opens new tabs/windows, also exposing their domain to my customers.

    Would it be possible to replace all instances of "affiliate.com" inside the iframe to "mysite.com"; whereas, "mysite.com" will be a proxy forwarding requests to "affiliate.com"? Keep in mind that these elements do not have ID or Class.

    Any advice is welcomed!

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,871
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    JavaScript has no access to the page in the iframe when it is a different domain.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Member
    Join Date
    Jul 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can any other languages do the job?


Bookmarks

Posting Permissions

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