Accessing an IMG tag within an IFRAME

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • threepins@gmail.com

    #1

    Accessing an IMG tag within an IFRAME

    Hi,

    I was wondering if it is possible to access an <img> tag that is buried
    within some external content in my site that is contained within an
    iFrame on a page within my site... confusing i know! For example:

    <html>
    <head>
    ....
    </head>
    <body>
    ....
    <div>
    <iframe src="http://contentfromanot hersiteihave">
    <img src="img i want to get">
    </iframe>
    </div>
    </body>
    </html>

    Obviously the ... means there is other stuff in there. Basically i want
    to show the img from the other content but hide the rest of the content
    on that page that is being loaded in the iframe. However, i'm not too
    great with javascript and using document.images only references one
    image (the main site's logo image).

    Any help would be greatly appreciated.

    Cheers
    Bj

  • David Dorward

    #2
    Re: Accessing an IMG tag within an IFRAME

    threepins@gmail .com wrote:
    [color=blue]
    > I was wondering if it is possible to access an <img> tag that is buried
    > within some external content in my site that is contained within an
    > iFrame on a page within my site.[/color]

    I doubt it. Security considerations put rather strict limits on what
    JavaScript running from a webpage on one host to a page on another.

    If you can, then the answer is in the FAQ.


    --
    David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is

    Comment

    Working...