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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:23:33+00:00 2026-05-26T08:23:33+00:00

i was exploring in the last few days how big frameworks works , how

  • 0

i was exploring in the last few days how big frameworks works , how they assign their function name and it can’t(?) be override , i pretty much know how framework work with anonymous function , for example they do it this way or similar version :

(function(){
   var Sizzle = function (){
      var x;
   };
   Sizzle.f = function(){
     alert("!");
   };

   window.Sizzle = Sizzle;

})();

i still don’t get few things about those huge frameworks and i hope i can find answer :

  1. how do they assign function name and the name can’t be override?
  2. in the code above to call the function i need to write Sizzle.f() to get the function to work , but when i use jquery i don’t write Jquery.show() , just show() , how do they vanish the “jquery” from “jquery.show()” function call?

by saying the name can’t be override i mean , if i create function with one of the jquery functions names , the jquery function will work.

thanks in advance.

  • 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-26T08:23:33+00:00Added an answer on May 26, 2026 at 8:23 am

    As has been shown for #2, it’s really easy for BIG_NAMESPACE.Functions.doStuff to be added to anything you want.

    var _ = BIG_NAMESPACE.Functions.doStuff;
    _(); // runs BIG_NAMESPACE.Functions.doStuff;
    

    As for #1:

    Most libraries DO let their functions be overwritten.
    It’s the values that are inside of the framework’s closure which are preserved, for safety reasons.

    So you could do something like:

    BIG_NAMESPACE.Functions.doStuff = function StealEverything() {};
    (BIG_NAMESPACE.Functions.doStuff === StealEverything) // true;
    

    But doStuff would have NO access to any of the variables hidden inside of the framework’s closure.
    It would also mean that until the page was reloaded, doStuff would also not work the way you want it to.

    HOWEVER, in newer versions of JavaScript (ECMA5-compatible browsers), it WILL be possible to do something like what you’re suggesting.

    BIG_NAMESPACE = (function () {
        var do_stuff = function () { console.log("doin' stuff"); },
            functions = {
                set doStuff (overwrite) { }
                get doStuff () { return do_stuff; }
            };
        return { Functions : functions };
    }());
    

    Then, this will work:

    BIG_NAMESPACE.Functions.doStuff(); // "doin' stuff"
    BIG_NAMESPACE.Functions.doStuff = function () { console.log("ain't doin' jack"); };
    BIG_NAMESPACE.Functions.doStuff(); // "doin' stuff"
    

    However, Frameworks aren’t going to use this for a LONG time.
    This is not even remotely backwards compatible. Maybe in 2016…
    There were defineGetter and defineSetter methods as well, but they aren’t a formal part of the JavaScript language. Like innerHTML, they’re things that the browser vendors put in, to make life better… …as such, there’s no real guarantee that they’re going to be in any/all browsers your users have. Plus, they’re deprecated, now that new browsers use the get and set constructs that other languages have.

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

Sidebar

Related Questions

Last Updated: 2009-08-11 2:30pm EDT A few days ago I posted this question about
Last time I'm exploring PHP pretty much and I was curious if it's possible
Last I heard, Blizzard was one of the few companies to put client-side XSLT
I'm exploring python and tried to sort all files from a directory by last
While exploring msdn sites ,most of the condition checking places they are using (NULL
I am exploring a pattern where you can save a global reference to the
The following code shows the posts made the last 30 days. Every post I
while exploring jQuery I came up with the following weird script. I don't see
I'm exploring the possibility of writing an application in Erlang, but it would need
I've been exploring different strategies for running integration tests within some Nant build scripts.

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.