homepage Welcome to WebmasterWorld Guest from 107.20.109.52
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Add text to iframe?
georgeek




msg:3542276
 3:50 pm on Jan 7, 2008 (gmt 0)

I have a iframe in a html page the displays one line of text.

<iframe src="external url" frameborder="0" width="189" height="15"></iframe>

I need to insert text into the iframe so it displays on one line like this:

Extra text here: iframe text here

How can I do this?

Thank you.

 

Trace




msg:3542397
 5:55 pm on Jan 7, 2008 (gmt 0)

Something like this?

index.html
<html>
<body>

<script type="text/javascript">
function text2add(){
return '<font color=red>This is my new text!</font>';
}
</script>

Main page! Frame below.

<br><br>

<iframe src="iframe.html"></iframe>

</body>
</html>

iframe.html
<html>
<body>

<script type="text/javascript">
document.write(parent.text2add());
</script>

This is my iframe

</body>
</html>


georgeek




msg:3542428
 6:25 pm on Jan 7, 2008 (gmt 0)

Thank you Trace but I don't understand where the original iframe (src etc,) goes.

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