Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8690693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:57:21+00:00 2026-06-12T23:57:21+00:00

On the script below, IE9 is throwing an error: SCRIPT5022: DOM Exception: INVALID_CHARACTER_ERR (5)

  • 0

On the script below, IE9 is throwing an error:

SCRIPT5022: DOM Exception: INVALID_CHARACTER_ERR (5)
mootools-1.2.1-core-yc.js, line 118 character 1

Document.implement({
    newElement: function (A, B) {
        if (Browser.Engine.trident && B) {
            ["name", "type", "checked"].each(function (C) {
                if (!B[C]) {
                    return;
                }
                A += " " + C + '="' + B[C] + '"';
                if (C != "checked") {
                    delete B[C];
                }
            });
            A = "<" + A + ">";
        }
        return $.element(this.createElement(A)).set(B); //THIS IS LINE 118
    },
    newTextNode: function (A) {
        return this.createTextNode(A);
    },
    getDocument: function () {
        return this;
    },
    getWindow: function () {
        return this.window;
    }
});

This snippet is part of the Mootools js library that the developer used on the site. Is there a workaround to fix the error for IE?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:57:23+00:00Added an answer on June 12, 2026 at 11:57 pm

    yeah that code is garbage, you should never do browser checks like that, its taught in JavaScript 101… lol can’t believe that’s in mootools? blech, anyways

    IE9 doesn’t allow for crazy document.createElement('<div style="background:red">yay!</div>'); syntax anymore (no one should’ve ever really been using it in the first place…)

    here’s an example:

    var d = document;
    var x = d.createElement('div');
    
    x.innerHTML = 'yay';
    x.style.backgroundColor = 'red';
    x.style.padding = '6px';
    x.style.margin = '20px';
    
    d.body.appendChild(x);
    
    var sameHTML = '<div style="background:green;padding:6px;margin:20px;">yay!</div>';
    
    // fails in IE > 8 and other browsers
    try {
      var y = d.createElement(sameHTML);
      d.body.appendChild(y);
    } catch (err) {
      d.body.appendChild(d.createTextNode(err)); 
    }
    
    // quick fix using innerHTML:
    var temp = d.createElement('div');
    temp.innerHTML = sameHTML;
    d.body.appendChild(temp.childNodes[0]);
    

    the way to fix this is to either create a dummy element and use .innerHTML and then extract the child, or inside mootools check the browser version and don’t do that for IE > 8 if i remember right mootools has a Browser.Engine.version or something to that effect…

    edit: i feel like i should also add that this: Browser.Engine.trident is the problematic check, and from the gyst of the code looks like it might occur else where too…

    aha! another update:
    i found this while looking through [an old] support thread:

    you’ll need to update to 1.2.5 or 1.3. Previous MooTools versions are not supported by IE9.

    so an update to the script should fix your problem, hopefully it won’t introduce more bugs… you can get it here: http://mootools.net/download, you might want to try that 1.2.5 version at the top of the page since it will have the least amount of changes…

    good luck -ck

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this script below for loading a hidden div, inside another: $(document).ready(function(){ $(function()
I have below script, it's doing fine in firefox and chrome. ie9 doesn't show
My script below generates a url if the $.post() response has an error. I
The script below works fine if 3 and 3.2 are not links but i
The script below, test.php, is intended to be placed in a specific directory of
The script below resides in my theme's functions.php file. It is designed to show
The script below worked on my Mac OS X. I'm now using Ubuntu OS,
The script below should open all the files inside the folder 'pruebaba' recursively but
My script below will use two external tables to fill two separate tables, but
I have the following script below where I try to mimic a file upload

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.