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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:27:32+00:00 2026-05-16T11:27:32+00:00

When using JQuery, extending an object that has an overridden toString() function causes an

  • 0

When using JQuery, extending an object that has an overridden toString() function causes an “Operation is not supported” error in Firefox. However in Chrome it works fine. Is this a bug in JQuery or am I doing something wrong in the below code snippet?

    var foo = function () {
        var that = this;

        that.toString = function () { return "foobar" };

        return that;
    }();

    var foo2 = function () {
        var that = this;            

        that = $.extend(true, {}, foo); // copy = options[ name ]; = "Operation is not supported" in Firefox 3.6.8

        return that;
    } ();

    alert(foo.toString()); //"foobar" in Chrome
    alert(foo2.toString()); //"foobar" in Chrome

JQuery version 1.4.2

Many thanks,

Godders

  • 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-05-16T11:27:33+00:00Added an answer on May 16, 2026 at 11:27 am

    When you call the anonymous function to get the value for “foo”, the this variable will be referencing the window object. Same goes for the anonymous function you call for “foo2”. Thus, you’re trying to extend the window object. Is that really what you want to do?

    edit what Firefox seems to be tripping over is the attempt to copy the “sessionStorage” attribute of window. Try adding this line:

    var test = window['sessionStorage'];
    

    and you’ll get the exact same error.

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

Sidebar

Ask A Question

Stats

  • Questions 502k
  • Answers 502k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It depends of your use, but in general I would… May 16, 2026 at 2:44 pm
  • Editorial Team
    Editorial Team added an answer A document is not directly connected to its parent document.… May 16, 2026 at 2:43 pm
  • Editorial Team
    Editorial Team added an answer $('.vpslink').click(function(e) { var id= $(this).attr('id'); alert('you clicked on id '… May 16, 2026 at 2:43 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Short version: I'm extending a jQuery object function that is intended to take 0-3
I just stumbled over a small problem when extending javascript objects using jQuery. When
When using jQuery's Accordion (in a nested fashion), I want to ensure that when
I'm using jquery Validation . I am trying to control where the error message
I'm working on a project that will be using a lot of select menus
I'm using a jQuery and the tablesorter plugin in my web page. My goal
I'm using the jquery tabs plugin and want to have the background a light
jQuery has opacity correction when you use css method (lines 4592-4608 on jQuery 1.4.2):
Using jQuery's UI Tabs. This is my code. <div id=tabs> <ul> <li><a href=#tabs-1>Find a
Using JQuery, how do I select all elements with class x within an element

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.