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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

load a url in a iframe

Status
Not open for further replies.

atferraz

Technical User
Aug 23, 2003
129
PT


I,ve this iframe in my page with another page loaded in it. How can I load another page from within that second page.

I've tried this:

document.getElementById("myIframeId").src="url" from a button but didn't work at all.
I can identify the iframe id with

document.getElementById("myIframeId").id

but just wont work.

thanks
 
on the page in the iFrame you would just say...

document.location = "newURL.htm"

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
Does nothing.
I’m calling a asp page and there is a response.write "hello" at the top of that page along with other stuff and cant make it talk. The interest thing is this: if I call it from outside (parent or a popUp child window) it gets there.
But I really must call it from the document it self. The links are there.
 
In the SCRIPT section of the page containing the IFRAME, change your line:

document.getElementById("myIframeId").src="url"

...to:

document.frames["myIframeId"].location = url; //assuming url is a variable set to the location you want and the frame is literally named "myIframeId".

'hope that helps.

--Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top