Web Hosting Talk







View Full Version : How To PUSH new window open with javascript


wscreate
10-31-2002, 12:12 AM
I am using a PHP chat script I created. The Chat writes to a file and then updates and opens the file every 5 seconds to display it in the chat window.

I want to be able to push a URL to my partner's chat window which will then open a new window in my partner's browser (Using javascript).

Something like a BODY onload command, but onload will not work in this instance.

Example =====
<BODY OnLoad="MakeWindow('newwindow.php','Title Of Page','')">
==========

Any suggestions?

Rich2k
10-31-2002, 05:59 AM
Of course if he has some form of advert popup blocker installed it won't work.

If it's just a plain php file then I don't see any reason why the onload won't work. Do you have some more details... and what is your MakeWindow function?

sasha
10-31-2002, 01:07 PM
You can open window on any EVENT no only onLoad: OnClick, onMouseOver ,onSubmit .....

RackNine
10-31-2002, 02:58 PM
Nice and simple:

<script>
window.location = 'http://www.racknine.com';
</script>

Sincerely,

-Matt

RackNine
10-31-2002, 02:59 PM
To clarify:

That can go anywhere in the <body></body> of a document. Seems to work with all browsers, though some may require a full script descriptor <script language="javascript">

Sincerely,

-Matt