Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing IFRAME src 4

Status
Not open for further replies.

peacecodotnet

Programmer
May 17, 2004
123
US
I tried changing the source of an IFRAME through javascript, but it didn't do anything. I regret that I am not at my home computer, so I don't have any code right now, but it went something like this:

in the JavaScript, I had:
TheFrame.src = "
and the frame looks like:
<iframe id="TheFrame" src=" width="100%" height="500"></iframe>

What am I doing wrong? Is there maybe a way to refresh the IFRAME only, without refreshing the rest of the page?

Any help is greatly appreciated.

Peace out,
Peace Co.
 
try
Code:
document.getElementById("TheFrame").src = '[URL unfurl="true"]http://www.othersite.com';[/URL]
 

Or modify your iframe to have a NAME attribute as well as the ID attribute. This way it can be used for targetting operations, too.

Hope this helps,
Dan
 
Forget the SRC and instruct the HTML to change the LOCATION of the IFRAME content.

e.g., TheFrame.location = "
Changing the SRC of the IFRAME tag does not force a reload of the contents of the IFRAME.

'hope that's what you needed.

--Dave
 
I believe the security settings wont allow you to modify the frame src/location href across domains.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top