[thelist] child windows

Erik Mattheis gozz at gozz.com
Mon Mar 10 09:56:01 CST 2003


On Monday, March 10, 2003, at 07:54  AM, Stevenson Ngila wrote:
> How can i refresh a child window everytime i update a parent window
> using
> javascript?

Would you be updating the parent using JavaScript? If so, easy, before
changing the parent location:

child_handle.location = 'new_location.html';

If you want all HTML links to trigger a change in the location of the
child window, a little more complicated, but this should do it:

function attachMouseEventsToAnchors() {
	if (document.getElementsByTagName) {
		my_anchors = document.getElementsByTagName('a');
		for (i=0; i < my_anchors.length; i++) {
			my_anchors[i].onmousedown = function() {
				if(child_handle && !child_handle.closed) {
					child_handle.location = 'new_location.html';
				}
			}
		}
	}
}

window.onload = attachMouseEventsToAnchors;

PS, don't expect me to do your work for you again unless I have again
just created a very similar function for my own purposes.
-----------------------
Erik Mattheis
GoZz Digital
<http://goZz.com/>
Flash and ColdFusion Development
Minneapolis, MN
-----------------------




More information about the thelist mailing list