Iframe and Javascript

  • baligena
  • Novice
  • Novice
  • baligena
  • Posts: 25

Post 3+ Months Ago

Is there a way for me to access a link in a iframe using javascript
  • Zealous
  • Guru
  • Guru
  • User avatar
  • Posts: 1244
  • Loc: Sydney

Post 3+ Months Ago

why don't you just use iframe in HTML and show the page where the link is? or you can add a hyperlink.
  • baligena
  • Novice
  • Novice
  • baligena
  • Posts: 25

Post 3+ Months Ago

Am I able to access what is in the iframe by using getElementsByTagName or its not possible considering it can be a security issue
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

You can do the following:

Code: [ Select ]
var mFrame = document.getElementById("frame_name");
var content = mFrame.contentWindow.document.body.innerHTML;
  1. var mFrame = document.getElementById("frame_name");
  2. var content = mFrame.contentWindow.document.body.innerHTML;
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

Ditch the iframe
  • baligena
  • Novice
  • Novice
  • baligena
  • Posts: 25

Post 3+ Months Ago

FYI

SpooF your code is not comparable with IE. Just switch 'contentWindow' with 'contentDocument' if anyone ever needs too.

Thankx

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 22 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.