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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript error in ie but not firefox

Status
Not open for further replies.

lucidtech

IS-IT--Management
Jan 17, 2005
267
US
here is the code that I think is causing the problem :

function updatePortfolioPage(page) {
if (page == "next") {
if (parseInt(document.count.current.value, 10) >= parseInt(document.count.maxx.value, 10)) {
document.count.current.value = 0;
}
count = parseInt(document.count.current.value, 10) + 1;
} else {
count = parseInt(document.count.current.value, 10) - 1;
if (parseInt(document.count.current.value, 10) == 1) {
count = document.count.maxx.value;
}
}
document.count.current.value = count;
thisTitle = eval("document.form_"+count).title.value;
len = thisTitle.length;
typeTitle = "<a href=\"javascript:updatePortfolio('"+count+"');\" style=\"text-decoration:none;\">";
for (i=0;i<=len;i++) {
thisChar = thisTitle.substr(i, 1);
if (thisChar == " ") {
typeTitle = typeTitle + "&nbsp;&nbsp;"
} else {
typeTitle = typeTitle + "<img src=\"assets/alphabet/white2/"+thisChar+".png\" height=\"20\" border=\"0\" />&nbsp;";
}
}
typeTitle = typeTitle + "</a>";
document.getElementById("scroll_title_1").innerHTML = typeTitle;
thisImage = eval("document.form_"+count).image.value;
document.getElementById("scroll_image_1").innerHTML = "<a href=\"javascript:updatePortfolio('"+count+"');\" style=\"text-decoration:none;\"><img width=\"260\" src=\"assets/sites/thumbnails/"+thisImage+".jpg\" border=\"0\" style=\"padding-bottom:6px;\" ><br><font style=\"font-size:12px;\">( click for more info )</font></a>";
//update second image
count = count + 1;
if (count > document.count.maxx.value) {
count = 1;
}
thisTitle = eval("document.form_"+count).title.value;
len = thisTitle.length;
typeTitle = "<a href=\"javascript:updatePortfolio('"+count+"');\" style=\"text-decoration:none;\">";
for (i=0;i<=len;i++) {
thisChar = thisTitle.substr(i, 1);
if (thisChar == " ") {
typeTitle = typeTitle + "&nbsp;&nbsp;"
} else {
typeTitle = typeTitle + "<img src=\"assets/alphabet/white2/"+thisChar+".png\" height=\"20\" border=\"0\" />&nbsp;";
}
}
typeTitle = typeTitle + "</a>";
document.getElementById("scroll_title_2").innerHTML = typeTitle;
thisImage = eval("document.form_"+count).image.value;
document.getElementById("scroll_image_2").innerHTML = "<a href=\"javascript:updatePortfolio('"+count+"');\" style=\"text-decoration:none;\"><img src=\"assets/sites/thumbnails/"+thisImage+".jpg\" width=\"260\" border=\"0\" style=\"padding-bottom:6px;\" ><br><font style=\"font-size:12px;\">( click for more info )</font></a>";
}

Or, you can just check the page out yourself at I have no idea what the problem is because IE gives next to no information when it gets an error.
 
Try putting alert() calls in that function to see where the error occurs.

Lee
 
Loading the URL you've given shows no errors in IE6. I did get an error when clicking on one of the left/right arrows, but am not sure if that's the error you are referring to (you haven't given any details).

If it is the same error, then that seems to be caused by this code:

Code:
function updatePortfolioPage(page) {
	if (page == "next") {
		if (parseInt(document.count.current.value, 10) >= parseInt(document.count.maxx.value, 10)) {
			document.count.current.value = 0;
		}
		count = parseInt(document.count.current.value, 10) + 1;
	} else {
		count =  parseInt(document.count.current.value, 10) - 1;
		if (parseInt(document.count.current.value, 10) == 1) {
			count = document.count.maxx.value;
		}
	}

IE seems to be complaining about the assignment to 'count'. Perhaps becuase your form has an ID of 'count', IE is getting confused - so why not remove the ID from your form, or rename your 'count' variable.

Also in IE6, all of your alpha-transparent PNGs look very bad - you need to use the AlphaImageLoader filter to get around this.

Hope this helps,
Dan


Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Just when I thought the list of reason why I despise IE couldn't possibly get any longer...

Thank you for the help Dan. I really appreciate it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top