473,763 Members | 6,638 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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","Pictur e","width=370,h eight=260,
toolbar=no,menu bar=no,resizeab le=no")';
echo '}';

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

echo "<BR>Successful ly executed PHP script!!!";
?>

</BODY>
</HTML>
Jul 23 '05 #1
4 5158
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.de mon.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.plus YOURSHIT.com> skrev i meddelandet
news:E2******** *************@w ards.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","Pictur e","width=370,h eight=260,
toolbar=no,menu bar=no,resizeab le=no")';

<snip>

Try single quote characters (apostrophes) around the feature string:
echo 'window.open("./01.jpg","Pictur e",\'width=370, height=260,
toolbar=no,menu bar=no,resizeab le=no\')';

Joakim Braun
Jul 23 '05 #4
In article <cv************ *******@nntpser ver.swip.net>, wrote:
Try single quote characters (apostrophes) around the feature string:
echo 'window.open("./01.jpg","Pictur e",\'width=370, height=260,
toolbar=no,men ubar=no,resizea ble=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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
6213
by: Bender | last post by:
Hi, I am wanting to capture an onmousedown event without firing the body tags onload event. Also, if anyone could explain why this happens that would be excellent. I can't see how an onmousedown event could bubble up to an onload event. NOTE: If you put an alert() statement in the onmousedown event handler the body onload event doesn't get fired.
4
4917
by: Pai | last post by:
hello there, I am trying to rersize the window it works find in IE but doea not work with mozilla window.attachEvent(onload,MWSOnLoad); window.onload = function (MWSOnLoad) { alert('hello'); window.resizeTo(810,750); top.outerWidth=810;
6
4578
by: Brian | last post by:
Hi everyone, I'm writing a function (in javascript) that needs to do one thing if the page has not loaded, and another (different) thing if the page has already loaded. I'm looking for a way to tell if the window.onload event has already fired. I cannot edit the onload event handler itself, and my function can only exist in an external js file, sourced from the document's head section. Any ideas?
1
10208
by: Adam Ratcliffe | last post by:
I'm trying to come up with a solution for detecting when an image, loaded by a script, has completely loaded. The Image.onload event is fired after the image has loaded in Firefox but before loading has completed in Internet Explorer. The function where I assign the onload event handler looks like this: var newImage = new Image(); function getImage(url) { var image = document.getElementById("theImg");
33
2866
by: abs | last post by:
Hi all. My list: <ul> <li id="a" onclick="show(this)">Aaaaaaaa</li> <li id="b" onclick="show(this)">Bbbbbbbb</li> <li id="c" onclick="show(this)">Cccccccc <ul> <li id="d" onclick="show(this)">111111</li>
2
6481
by: Martin Honnen | last post by:
I was playing around with canvas support in recent Safari, Mozilla and Opera (only version 9 preview) but run into issues with Safari related to the very old DOM Level 0 Image object for preloading images. When doing e.g. var img = new Image(); img.onload = function (evt) { alert(this); }; img.src = 'whatever.gif';
3
3496
by: buhailiang | last post by:
I've a 'TEST' link on page, which has href='javascript: void(0)', and a big iframe page. When I load the page, window.onload event is triggered after the big iframe page loaded, If I click the 'TEST' link before the window.onload execute, the window.onload will never execute in IE 6.0. <html> <body>
3
3928
by: willyWEB66 | last post by:
Hi everyone, I'm having problem with the sequence of execution for xml.onload. It works fine if your not passing parameters to onload event but my code needs to pass parameter to its function. I'm able to research ablut passing parameters for onload event. However my problem is it only executes on the last instance of loading the XML. I'm sure ur all pretty confused. I'll show some of the javascript code: <script...
0
9564
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9387
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10148
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9938
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3528
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2794
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.