homepage Welcome to WebmasterWorld Guest from 54.161.214.221
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Help With Javascript And Iframe
BlackRaven




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

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




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

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]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved