[thelist] Prevent a request from redirecting browser....

Jay Blanchard jay.blanchard at niicommunications.com
Fri Apr 1 07:28:49 CST 2005


[snip]
...
So add the short piece of javascript to the head-element of the pages in
your app:

<script language="JavaScript" type="text/JavaScript">
<!--
self.name='myappwindow';
//-->
</script>
...
To test it out, try clicking the following link several times. If you
have
javascript enabled, it should spawn a new window every time (given
enough
time for the previous to finish loading, which is not much).

http://www.ilmiantajat.net/testing/zuni/
[/snip]

As I read this I thought to myself that this was brilliant in its
simplicity. So here is what I tried (I haven't done a lot this morning
with it yet, just a couple of tests). First, the javascript to open the
pop-up;

<script language="JavaScript">
<!--
twin=window.open("adminTicketQueue.php","ttrackApp","width=1024,height=7
10,menubar=no,toolbar=no,directories=no,location=no,scrollbars=yes,resiz
able=yes,status=no");
twin.moveTo(0,0);
//-->
</script>

And the bit in the page to set the self-name;

<script language="JavaScript">
	<!-- name the application window to hopefully prevent opening by
other links
	self.name = 'ttrackApp';
	-->
	<!-- use to "fool" windows closing dialog
	window.opener = 'active';
	-->
</script>

And then I loaded it up, came back to the link you supplied, clicked it
and it opened in my newly named appplication window. (I am using
Outlook, so perhaps I need to conduct the tests that you did with the
alert window.)

So I am still hopefully working towards a solution.


More information about the thelist mailing list