| | |
getElementById is not a function
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jun 2004
Posts: 2,108
Reputation:
Solved Threads: 18
I'm testing something on an old version of netscape, specifically 4.7. Everythings fine except for my javscript function doesn't work because it says getElementById is not a function:
document.getElementById('ncp').src = "ncp" + pictureNum + ".jpg";
I've got many more of these type lines but it works fine in IE and FF. Is there something I can do to make this compatible with netscape browsers?
document.getElementById('ncp').src = "ncp" + pictureNum + ".jpg";
I've got many more of these type lines but it works fine in IE and FF. Is there something I can do to make this compatible with netscape browsers?
•
•
Join Date: Dec 2004
Posts: 1,655
Reputation:
Solved Threads: 35
You'll have to navigate the hierarchy. For example, use the document.images collection.
I made the decision long ago that I simply wasn't going to worry myself, or add huge development overhead, to supporting old browers, particularly for corporate development projects and/or sites. Use a strict DOCTYPE, code to that standard, cut down on the fancy stuff, and use server-side code as much as possible.
I made the decision long ago that I simply wasn't going to worry myself, or add huge development overhead, to supporting old browers, particularly for corporate development projects and/or sites. Use a strict DOCTYPE, code to that standard, cut down on the fancy stuff, and use server-side code as much as possible.
•
•
Join Date: Aug 2004
Posts: 49
Reputation:
Solved Threads: 1
Netscape 6+ supports getElementById.
If you require support for Netscape 4 (about 1 visitor in 500 or less now) then you need to use document.layers instead just for those visitors and use getElementById for everyone else.
If you require support for Netscape 4 (about 1 visitor in 500 or less now) then you need to use document.layers instead just for those visitors and use getElementById for everyone else.
![]() |
Similar Threads
- Getting the height and width of content fitting DIV element. (JavaScript / DHTML / AJAX)
- Error Microsoft OLE DB/ODBC (0x80004005) Access (ASP)
- how to make animation bar in vb.net (ASP.NET)
- A new image swap? (JavaScript / DHTML / AJAX)
- this. method is working "backwards" (JavaScript / DHTML / AJAX)
- Is my code wrong or is Opera? (JavaScript / DHTML / AJAX)
- 'Lock Down' a form (PHP)
- How can fix the problem? (JavaScript / DHTML / AJAX)
- Forms Not Returning Correct Information (JavaScript / DHTML / AJAX)
- Forms (JSP)
Other Threads in the HTML and CSS Forum
- Previous Thread: HTML Introduction
- Next Thread: css help plzz
Views: 7117 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for HTML and CSS
2002 appointments asp background backgroundcolor beta browser bug calendar cart center cgi code codeinjection corporateidentity create css deleted design development displayimageinsteadofflash dreamweaver drupal emailmarketing epilepsy explorer firefox flash font fonts form format free frontpage google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft missing mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization perl pnginie6 positioning problem scroll seo shopping studio swf swf. templates textcolor theme timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7 wordpress xml xsl






