Does anyone know of possible reasons why onload might not be working? It's gotta be the most pathetic question ever, it's doing my head in!! I've done this a dozen times, but on this one, nothing! I just can't see what the problem might be.
Here's the background:
Initially the idea was to run a js function using
in an external js script which is linked to in the common header (that link works fine as other functions in the same script run as and when they're supposed to). Wouldn't do anything, but I've had that problem elsewhere before and while I never knew why it wouldn't work for me, back then I managed to fix it by using
instead.
So I tried the same again this time - but it's still not working. It's not the function I'm calling, it works fine when I call it other ways - but I need it onload.
So I thought, let's drill down to the most basic thing ever:
and that's is not working either! Nor some variation thereof, like
What the HECK? Any and all suggestions what I might try, please?
Thanks!
Here's the background:
Initially the idea was to run a js function using
Code:
window.onload = function() {
myfunction();
}
Code:
<body onload="myfuntion();">
So I tried the same again this time - but it's still not working. It's not the function I'm calling, it works fine when I call it other ways - but I need it onload.
So I thought, let's drill down to the most basic thing ever:
Code:
<body onLoad="alert('hello world!')">
Code:
<body onload="javascript: alert('hello world!');">
Thanks!
Comment