Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE javascript error only when in compatibility view

Status
Not open for further replies.

shopwise

Technical User
Joined
Sep 22, 2008
Messages
52
Location
US
I receive this error:

'document.getElementById(...)' is null or not an object

on IE only when not in compatibility view.

This is the code that the error is alluding to:

var ccurrentImage;

function cshowBigImage( cisource,cbigImage,cheader ) {

var ctheImage = document.getElementById( 'clargeimage' );

ctheImage.src = cisource;

ccurrentImage = cbigImage;

document.getElementById('cphotoHeader').innerHTML=cheader;

document.getElementById( 'clargeimage' ).alt=cheader;
 
Do all of those elements exist with those IDs? Are all of those IDs unique? Does your code validate?

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Also check the case of the IDs matters, so "cphotoHeader" would not be the same as "cphotoheader", for example.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
I had the ID in the wrong case!!!thanks so much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top