...

View Full Version : onClick problem



sassy_monix
12-09-2004, 02:58 PM
Hi, I have this script



function loadIframe(iframeName, url) {
frames[iframeName].location.href = url;
}


and I want to use it in my link tag <a href=...> so that when someone clicks on it the function will load.

Can somebody correct the sytax for me please?! :confused:
THANKS!!

Kor
12-10-2004, 12:03 PM
Why not a direct HTML ?

<a href="foo.html" target="iframe_name"> ?

Anyway, here's :

function loadIframe(iframeName, url) {
top.frames[iframeName].location.href = url;
}
...
<a href ="#" onclick="loadIframe('iframe_name', 'foo.html');return false">
...
<iframe name="iframe_name" src="blah.html"></iframe>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum