pantagruel wrote:
Quote:
ruel <rasmussen.br...@gmail.comwrote:
Quote:
>the browser is firefox
>>
>the javascript
:
>>
>function slideshowchecker(){
>>
>if(document.getElementById){alert('it works');}
>slide = document.getElementById("slideX");
>>
>if(slide==null){
>alert('yes2');
>>
>}
>}
>>
>window.onload=slideshowchecker();
window.onload = slideshowchecker;
Don't use the call operator, when assigning functions to events.
If you need to pass the event:
window.onload = function(e) { alert('on' + e.type); }
If you need to pass arguments:
window.onload = function()
{
func1('arg1', 'arg2');
}
Quote:
Quote:
>the document has a div id = slideX.
>both alerts keep coming up.
>>
>here is the html
>>
><!DOCTYPE HTML PUBLIC
>"-//W3C//DTD HTML 4.01 Transitional//EN"
>"http://www.w3.org/TR/html4/loose.dtd">
><html><head><title>slideshow</title><script
>>
>src="jscripts/GTA.js" ></head><body><div class="slide" id="slideX">
>grrrrrrrr
>>
></div></body></html>
>>
>Why is slideX coming up null?
>>
>I'm really tired, I've been working from noon to 9 pm yesterday and
>from 1 am to 5 am this morning.
<attempt to fix top post>
Quote:
On May 13, 5:40 am, pantag
oh wait, just realized, the script is executing before the div exists
so slide is null.
What is "GTA.js?" I ask only because I am a Grand Theft Auto fanatic.
If it has something to do with that, you must share. :)
--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.