Problems with JavaScript in IE8: String not supported error message RRS feed

  • Question

  • Hi

    I am able to work and debug (using Developer Tools F12-key) in JavaScript in IE8.

    However, I am having a problem whereby ALL commonly expected JavaScript string methods are not supported, for example [b]split()[/b], they return the following error in the IE8 script debugger: Object doesn't support this property or method

    Why would this occur and how can make sure that String methods are made available?

    This seems to be a common problem but I have not found a definitive answer.


    Jeff in Seattle

    Thanks Jeff in Seattle
    Monday, September 28, 2009 7:25 PM

All replies

  • Sounds like the string is not a string but something else; null or undefined etc. You can confirm by doing:

    var a = "hello";
    var b = new String("world");
    console.log(typeof a == "string" || a instanceof String);
    console.log(typeof b == "string" || b instanceof String);

    • Edited by Salman A Sunday, March 10, 2013 5:28 PM
    Tuesday, September 29, 2009 8:43 AM