Expected Identifier error in IE

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

Expected Identifier error in IE

Post by kendall »

I have a piece of javascript "class" object...


Code: Select all

var DisplayErrorFields = null;
function DisplayErrorFields(){

	this.errorClassName = 'error'; // css style
	this.successClassName = 'success'; // css style
	this.setElementSuffix = null; // for highlighting field label or corresponding element
	this.theForm = '';
	// display
	this.highlightErrorFields = function(){
		if(this.highlightErrorFields.arguments < 1){
			return false;
		}
		var elements = this.highlightErrorFields.arguments;
		var noElements = elements.length;
		var class = this.errorClassName;
		var suffix = this.setElementSuffix;
		for(i=0;i<noElements;i++){
			var ele = this.getFormField(elements[i]);
			if(ele){
				MM_changeProp(ele.id,'','className',class);
				var eleTag = MM_findObj(ele.id+suffix);
				if(suffix && eleTag)
					MM_changeProp(eleTag.id,'','className',class);
			}
		}
	}
	// find form field
	this.getFormField = function(fieldName){
		var formObj = this.theForm;
		var formElements = formObj.elements;
		var noElements = formElements.length;
		for(i=0;i<noElements;i++){
			if(fieldName == formElements[i].name)
				return formElements[i];
		}
		return false;
	}
}

When i run this bit of code in Firefox it works fine. However in IE i get a
Expected Identifier
what does this error mean?

for the record if i were to comment out the above code the page would load fine without error
Post Reply