onLoad event does not work on locally saved pages



16 years ago
14 years ago


(Reporter: paul, Assigned: asa)


Windows 2000

Firefox Tracking Flags

(Not tracked)



(1 attachment, 1 obsolete attachment)



16 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20021225
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20021225

When loading an HTML file from the local drive, the onLoad event does not seem
to fire. We have a Visual Basic program which writes the HTML file (with a form)
to the local hard disk and then loads the page into default browser to send the
form data - the onLoad event on the page which our webserver produces works, so
it seems to only be on local pages. IE works fine, NS4 does not either though.

Reproducible: Always

Steps to Reproduce:
(With Windows)
1. Save any HTML page with an onLoad event in the body tag.
2. Double-click the file to open it into default browser (should be Mozilla, if
not change the default first!)

Actual Results:  
onLoad event does not fire (in my example, does not submit the form)

Expected Results:  
onLoad should fire (in my example, form should be submitted)

Comment 1

16 years ago
Created attachment 110341 [details]
Sample HTML file to use for the above bug.

Comment 2

16 years ago
I'm sorry, but I don't see any occurence of "onLoad" inside the page you
attached. Are you sure you attached the right example? 

Of course it's no wonder nothing fires on page load, as there's simply nothing
to fire there.

Comment 3

16 years ago
Agreed, there doesn't seem to be any javascript in the sample page at all. I
also suspect this bug should be under the DOM Events component.

Comment 4

16 years ago
Created attachment 110403 [details]
CORRECTED sample file.... (Oops!)
Attachment #110341 - Attachment is obsolete: true

Comment 5

16 years ago
What I see after loading this example off the net (BOTH locally and
non-locally), is:

Error: frmBooking is not defined

in Javascript console, and the page is blank (2002121008/NT4).

After you change that line to

<BODY BGCOLOR=WHITE onLoad='document.forms["frmBooking"].submit();'>

it starts working just fine.

Please try doing so, and tell us if that fixed your problem.

Comment 6

15 years ago
Reporter: Can you reproduce this bug with a recent build of Mozilla (for
example, 1.4rc3)? 

If so, then please comment again with details. 
If not, then please resolve this bug as WORKSFORME. Thanks.

Comment 7

15 years ago
Using the sample file, it works in IE, but using Wesha's small change it does
seem to work fine.
Last Resolved: 15 years ago
Resolution: --- → WORKSFORME

Comment 8

15 years ago
Who said IE does everything _correctly_...

Yes it works in IE like that, but it's just another Microsoft's tiny little

Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.