View Full Version : Frame change text
rcollins
08-08-2002, 07:29 PM
I need to change the text in a heading frame when the user navigates to some page on the site. This text would be a simple string such as "Events". Problem this has to be controled by actions in another frame. I know I can use graphics and java but am looking for a simple way to send a text string to this title frame without the bother of creating graphic headers. Can it be done?
In your header page:
<div id="text"></div>
This is the target for your message
In the page that is loaded into another frame:
<script>
setTimeout("parent.header.text.innerHTML='your text'",1000)
</script>
The reason it is best to have a timeout is because if the main page is loaded before the header page you will get an error message such as:
parent.header.text is null or not an object
I use this method in various sections on my site.
For more on this see:
www.huntingground.freeserve.co.uk/scripts/phan_lay/phantom.htm
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.