Guest Juiice Posted October 14, 2005 Share Posted October 14, 2005 keep getting that error when I open my page in internet explorer... can't seem to find out what it is that I am doing wrong :SThe main page is located at http://homepages.adc.fcj.hvu.nl/1182816/portfolio/home.htm and the javascript is located at http://homepages.adc.fcj.hvu.nl/1182816/po.../styles/home.jsIf you got any clue what might be wrong, please say so becouse I am completely new at javascripting. Link to comment Share on other sites More sharing options...
Chocolate570 Posted October 14, 2005 Share Posted October 14, 2005 Hmm...if (document.getElementById) {is that allowed? Do any actually knowledgable javascripters know? Link to comment Share on other sites More sharing options...
Jack McKalling Posted October 14, 2005 Share Posted October 14, 2005 Nope, not allowed.En Juiice, om die fout uit te leggen: als er een foutmelding wordt weergegeven dat .getSomeThing(...) leeg is of geen object is, betekent dat, dat die instructie niet gevonden kan worden op je document :(In dit geval was het dat je opgegeven hebt dat het moet zoeken naar een element met een speciaal ID naam, maar niet WELK En tja, dan kan hij het niet vinden ook :)Je zou het zo moeten schrijven:if (document.getElementById("een_of_andere_ID")){...}Deze instructie vraagt of dat element aanwezig is, zo ja, dan voert het de script regels tussen ze accolades uit :DTranslation: what that error meant, and how she should prevent that error specially in this situation. Link to comment Share on other sites More sharing options...
Jonas Posted October 14, 2005 Share Posted October 14, 2005 Nope, not allowed.En Juiice, om die fout uit te leggen: als er een foutmelding wordt weergegeven dat .getSomeThing(...) leeg is of geen object is, betekent dat, dat die instructie niet gevonden kan worden op je document :DIn dit geval was het dat je opgegeven hebt dat het moet zoeken naar een element met een speciaal ID naam, maar niet WELK En tja, dan kan hij het niet vinden ook :)Je zou het zo moeten schrijven:if (document.getElementById("een_of_andere_ID")){...}Deze instructie vraagt of dat element aanwezig is, zo ja, dan voert het de script regels tussen ze accolades uit :)Translation: what that error meant, and how she should prevent that error specially in this situation.<{POST_SNAPBACK}> Psh, yeah. Totally got that... Link to comment Share on other sites More sharing options...
Chocolate570 Posted October 14, 2005 Share Posted October 14, 2005 Google really needs to get a dutch translator. Link to comment Share on other sites More sharing options...
Webworldx Posted October 15, 2005 Share Posted October 15, 2005 Are you sure you know what you're talking about Dan The Prof? You are allowed to test for commands like document.getElementById usingif( document.getElementById ) {testing for compatibility with older browsers / text based ones...For instance.. QuirksMode..:http://www.quirksmode.org/js/dhtmloptions.html Link to comment Share on other sites More sharing options...
Jack McKalling Posted October 16, 2005 Share Posted October 16, 2005 Maybe in Dhtml, you could be right. I don't recognise it inside JavaScript used in Xhtml, nor when used in Html (does that make any difference ?)But according to me, GetElemetById should also define which Id, don't blame me if I'm still wrong; I'm no expert, only read lots of codes. Never found it without the Id definition @ Jonas & Chocolate570: I just explained in Dutch because I instandly recognised my own laguage in her Error message :(Tried to make it clear to you Translation: what that error meant, and how she should prevent that error specially in this situation. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now