Welcome to WebmasterWorld Guest from 54.147.63.124

Forum Moderators: open

Message Too Old, No Replies

Add text to iframe?

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

Preferred Member

10+ Year Member

joined:Nov 19, 2002
posts:423
votes: 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.

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

Preferred Member

10+ Year Member

joined:July 5, 2005
posts:352
votes: 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>

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

Preferred Member

10+ Year Member

joined:Nov 19, 2002
posts:423
votes: 0


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