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 7844741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:59:10+00:00 2026-06-02T16:59:10+00:00

This function works in some IE browsers, but does not work in all. IE

  • 0

This function works in some IE browsers, but does not work in all.
IE 8 gives me an error:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB7.3; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET4.0C; .NET4.0E; MS-RTC LM 8)
Timestamp: Wed, 25 Apr 2012 15:18:21 UTC

Message: Object doesn't support this property or method
Line: 9
Char: 17
Code: 0
URI: file:///G:/1.html

Code:

GetLink();

function GetLink() {
   selectedOption = "asdasdasd: asdasdas|asdadasd:asdadsasd|asdasdasd:asdasdad";
   ROOM = selectedOption.split("|")[0].trim().split(":")[1].trim();
   BUILDING = selectedOption.split("|")[1].trim().split(":")[1].trim();
   var ret = "room_chart.jsp?room=" + ROOM + "&building=" + BUILDING;
   return ret;
}
  • 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-02T16:59:13+00:00Added an answer on June 2, 2026 at 4:59 pm

    The split method is fine, it’s trim that’s causing the problem. You can use this little polyfill from MDN:

    if(!String.prototype.trim) {
      String.prototype.trim = function () {
        return this.replace(/^\s+|\s+$/g,'');
      };
    }
    

    String.prototype.trim is not available in IE < 9. The snippet of code above simply adds the split method to String.prototype if it doesn’t already exist, and behaves exactly as you would expect the native implementation to.

    If you are using jQuery, there is a $.trim method you can use.

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

Sidebar

Related Questions

I have no idea why this doesn't work, but doing some validation functions and
This matrix transposition function works, but I'm trying to understand its step by step
I'm using this function: preg_match_all('/((\d{9})\.html)/s', $content, $results); It works fine but i just want
EDIT: My main code no longer works, should this function work? <script type=text/javascript src=jquery-1.7.2.js></script>
I don't understand this at all. Here is some Javascript code that works in
I am using this jquery function that works fine in win/mac FF 3.5 and
When I call this function, everything works, as long as I don't try to
This is what I have and it works: $(function(){ $('.slide-out-div').tabSlideOut({ tabHandle: '.handle', //class of
I want a debug function-macro that works like this: int myVar = 5; PRINTVAR(myVar);
This is my object : var obj = { a:{ x:1 y:function(){return this.x //works

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.