Jump to content

Recommended Posts

I have a copy of lightbox running on my site that included a 'prototype.js' file that has been running for years. Lately, during debugging the IE developer tools is stopping on this line with the error shown:

 

var el = document.createElement('<input name="x">');

InvalidCharacterError

 

This line is part of this:

 

var HAS_EXTENDED_CREATE_ELEMENT_SYNTAX = (function(){

try {

var el = document.createElement('<input name="x">');

return el.tagName.toLowerCase() === 'input' && el.name === 'x';

}

 

Can anyone provide a work-around for this or should I just not worry about it?

Link to comment
https://forums.phpfreaks.com/topic/301210-error-in-prototypejs/
Share on other sites

You most likely have your developer tools configured to stop on all errors. During a normal run that error would be caught by the try{} block and ignored.

 

That function is testing to see if the browser supports using createElement with a full tag. The standards compliant way to use createElement is to specify only the tag name, such as:

 

document.createElement('input');
To get IE to ignore it while debugging you need to change the exception behavior. There is a button for this in the toolbar that looks a bit like a stop sign. Shortcut is ctrl+shift+e.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.