Welcome to WebmasterWorld Guest from 54.145.39.186

Forum Moderators: open

Message Too Old, No Replies

Help With Javascript And Iframe

     

BlackRaven

7:10 pm on Jan 27, 2008 (gmt 0)

10+ Year Member



Trying to change the src of an iframe however its not working?

<head>
<title>test</title>
<script language="javascript">
document.frames['gorsel'].location.href = 'http://www.google.com';
</script>
</head>

<body>
<iframe id="gorsel" src="about:blank"></iframe>
</body>

daveVk

11:02 pm on Jan 27, 2008 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



You need to wait until page is load, use onload on body to call function.

ps Also try "src" instead of "location.href"

[edited by: daveVk at 11:22 pm (utc) on Jan. 27, 2008]

 

Featured Threads

Hot Threads This Week

Hot Threads This Month