0

Possible Duplicate:
.trim() in JavaScript not working in IE

i have the following code but in IE it says that the trim method is not supported.

    for (var i = 0; i < here.length; i++) {

        if ($(here[i]).html().trim() == "")
            $(here[i]).parent().find('#content').css('width', '656px'),
            $(here[i]).parent().find('#content p').css('width', '430px');

        if ($(another[i]).html() != null) {
            if ($(another[i]).html().trim() == "")
                $(another[i]).parent().parent().css('display', 'none'),
                $('#sidemenu .heading').css('background', 'none');
        }
    }

How do I fix it?

Community
  • 1
  • 1
Simon Dragsbæk
  • 2,367
  • 3
  • 30
  • 53

1 Answers1

1

Older versions of Browsers (e.g. IE before version 9) don't have a trim method for strings implemented in their Javascript. You have these options:

Community
  • 1
  • 1
codeling
  • 11,056
  • 4
  • 42
  • 71