seb0
05-26-2005, 11:27 AM
Hi
I have a page with an onload handler set, but it doesn't seem to be firing in a small minority of user's.
...
<body style="margin: 0; padding: 0;" bgcolor="#FFFFFF" onload="body_onload();">
...
<script language="javascript" type="text/javascript">
...
function body_onload() {
var f = document.forms.search;
if (!f) f = document.getElementById("search");
... code that uses f ...
}
</script>
...
The code that uses the reference f updates a hidden form field with a value. When the user submits the form on this page (not shown), that value is returned to the server. I know the code in body_onload() is not being run because we are getting submits of this form, but no value in the hidden form field the code updates.
I also have a handler attached to window.onerror, with that handler putting the javascript error into a hidden form field and posting that back too. In many cases the onerror handler doesn't seem to be firing either.
From our logging, there seems to be no correlation with browser vendor/version or ISP (it affects all major modern browsers).
It works for me in every modern browser I can get my hands on (IE 5.x & 6, NN6, Firefox 1.x, Opera 7.x & 8.0).
I have spent many hours searching Google, this forum and other forums, to no avail.
Has anybody here had the onload and/or onerror events not fire in some cross-section of browsers (not a particular vendor's browser or version) for some unknown reason?
Thanks in advance
Sebastian
I have a page with an onload handler set, but it doesn't seem to be firing in a small minority of user's.
...
<body style="margin: 0; padding: 0;" bgcolor="#FFFFFF" onload="body_onload();">
...
<script language="javascript" type="text/javascript">
...
function body_onload() {
var f = document.forms.search;
if (!f) f = document.getElementById("search");
... code that uses f ...
}
</script>
...
The code that uses the reference f updates a hidden form field with a value. When the user submits the form on this page (not shown), that value is returned to the server. I know the code in body_onload() is not being run because we are getting submits of this form, but no value in the hidden form field the code updates.
I also have a handler attached to window.onerror, with that handler putting the javascript error into a hidden form field and posting that back too. In many cases the onerror handler doesn't seem to be firing either.
From our logging, there seems to be no correlation with browser vendor/version or ISP (it affects all major modern browsers).
It works for me in every modern browser I can get my hands on (IE 5.x & 6, NN6, Firefox 1.x, Opera 7.x & 8.0).
I have spent many hours searching Google, this forum and other forums, to no avail.
Has anybody here had the onload and/or onerror events not fire in some cross-section of browsers (not a particular vendor's browser or version) for some unknown reason?
Thanks in advance
Sebastian