js in ie 9

JavaScript related questions should go here.
Post Reply
jonathon
Posts: 50
Joined: Fri May 06, 2011 5:09 pm

js in ie 9

Post by jonathon »

Hello :)

I've just found an error in my moo tools library. Well when I say error, IE9 says error and i didn't find it, IE9 did! No one else does. Basically in this code i get the error:
Message: DOM Exception: INVALID_CHARACTER_ERR (5)
Line: 1410
Char: 3
Code: 0
Document.implement({

	newElement: function(tag, props){
		if (Browser.Engine.trident && props){
			['name', 'type', 'checked'].each(function(attribute){
				if (!props[attribute]) return;
				tag += ' ' + attribute + '="' + props[attribute] + '"';
				if (attribute != 'checked') delete props[attribute];
			});
			tag = '<' + tag + '>';
		}
		return $.element(this.createElement(tag)).set(props); // error line
	},


I know what you're thinking, go over to moo tools and get the latest library. But i did that and the whole image slider broke on all browsers. So for the moment, I'm looking to patch up this error (and hope it's only 1 error).

But i'm clueless as to what could be wrong with this line? Wondered if anyone else may know?

Thanks in advance?


Jonathon
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: js in ie 9

Post by jacek »

According to http://www.ibiblio.org/xml/books/xmljav ... 09s10.html
DOMException.INVALID_CHARACTER_ERR

A Unicode character was used where it isn’t allowed; for example, an element name contained a dollar sign or a text node value contained a form feed. Many DOM implementations miss at least some problems that can occur with invalid characters. This exception is not thrown as often as it should be.
So based on that, I doubt that the error is actually to do with that line. Perhaps try making sure your html is valid ? Also you could try jslint.com which sometimes helps.
Image
jonathon
Posts: 50
Joined: Fri May 06, 2011 5:09 pm

Re: js in ie 9

Post by jonathon »

Thanks Jacek,

I'll give it a bash, see if I can sort it. It's not too bad for the moment till IE 9 gathers some steam. But annoying :(
Post Reply