Getting iframe code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BaKo
    New Member
    • Sep 2007
    • 11

    Getting iframe code

    Hey. I have an iframe in my page that contains a remote web page (not on my server). How would I use javascript to get the code inside the iframe?
    I tried

    alert(document. frames[0].document.body. innerHTML);

    but no luck :[ Any suggestions?

    Thanks!
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    #2
    Originally posted by BaKo
    Hey. I have an iframe in my page that contains a remote web page (not on my server). How would I use javascript to get the code inside the iframe?
    I tried

    alert(document. frames[0].document.body. innerHTML);

    but no luck :[ Any suggestions?

    Thanks!
    Listen Cross site Scripting is not supported by JavaScript.
    It is for security purpose.

    Debasis Jana

    Comment

    • gits
      Recognized Expert Moderator Expert
      • May 2007
      • 5388

      #3
      without involving serverside code ... you cannot do that ... as dmjpro said ;)

      kind regards

      Comment

      Working...