469,909 Members | 1,686 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,909 developers. It's quick & easy.

Problem with OnLoad event

I have a page which is a mixture of PHP and Javascript, it's not a PHP
problem as it is only printing the Javascript I want out to the browser.
When the page executes, in Internet Explorer the onload popup event is
executed successfully, but in Mozilla Firefox it does nothing at all.

Anyone know what is going on? Below is the script code (carriage return
deliberate to stop word wrap).

Thanks

Dariusz

<HTML>
<BODY onload="PicLoad()">

<?PHP
// Section to generate the Javascript pop-up for correct
// dimentions of the proposed pop-up.

echo '<script type="text/javascript">'."\n";
echo '<!--'."\n\n";

echo 'function PicLoad()';
echo '{';
echo 'window.open("./01.jpg","Picture","width=370,height=260,
toolbar=no,menubar=no,resizeable=no")';
echo '}';

echo '//-->'."\n";
echo '</script>';

echo "<BR>Successfully executed PHP script!!!";
?>

</BODY>
</HTML>
Jul 23 '05 #1
4 5029
Dariusz wrote:
I have a page which is a mixture of PHP and Javascript, it's not a PHP
problem as it is only printing the Javascript I want out to the browser.
When the page executes, in Internet Explorer the onload popup event is
executed successfully, but in Mozilla Firefox it does nothing at all.


Mozilla has anti-spam features which block window.open when triggered from
onload events (among other things). You might have these enabled.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Jul 23 '05 #2
In article <c5*******************@news.demon.co.uk>:
Mozilla has anti-spam features which block window.open when triggered from
onload events (among other things). You might have these enabled.


Just checked, and Javascript pop-ups are enabled on my setup.

Can't see why it's not working when it should be.

Dariusz
Jul 23 '05 #3
"Dariusz" <ng@lycaus.plusYOURSHIT.com> skrev i meddelandet
news:E2*********************@wards.force9.net...
I have a page which is a mixture of PHP and Javascript, it's not a PHP
problem as it is only printing the Javascript I want out to the browser.
When the page executes, in Internet Explorer the onload popup event is
executed successfully, but in Mozilla Firefox it does nothing at all.

Anyone know what is going on? Below is the script code (carriage return
deliberate to stop word wrap).

Thanks

Dariusz

<HTML>
<BODY onload="PicLoad()">

<?PHP
// Section to generate the Javascript pop-up for correct
// dimentions of the proposed pop-up.

echo '<script type="text/javascript">'."\n";
echo '<!--'."\n\n";

echo 'function PicLoad()';
echo '{';
echo 'window.open("./01.jpg","Picture","width=370,height=260,
toolbar=no,menubar=no,resizeable=no")';

<snip>

Try single quote characters (apostrophes) around the feature string:
echo 'window.open("./01.jpg","Picture",\'width=370,height=260,
toolbar=no,menubar=no,resizeable=no\')';

Joakim Braun
Jul 23 '05 #4
In article <cv*******************@nntpserver.swip.net>, wrote:
Try single quote characters (apostrophes) around the feature string:
echo 'window.open("./01.jpg","Picture",\'width=370,height=260,
toolbar=no,menubar=no,resizeable=no\')';


Didn't help.

However, I found out that despite Firefox browser having the setting to
allow popups enabled (I even tested it on external sites and it worked)...
it somehow assumed I did not want popups on "localhost", which is why I did
not see any. What the config said and what it actually was doing was
totally different.

After editing the config files for the browser it allowed me to see the
popup from "localhost".

Thanks to everyone for their help.

Dariusz
Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Pai | last post: by
1 post views Thread by Adam Ratcliffe | last post: by
33 posts views Thread by abs | last post: by
3 posts views Thread by buhailiang | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.