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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:08:59+00:00 2026-05-27T00:08:59+00:00

I found following in javascript code function calculateURI(uri) { return (namespace.push.configuration.uriPrefix || ”) +

  • 0

I found following in javascript code

function calculateURI(uri) {
        return (namespace.push.configuration.uriPrefix || '') + uri + (namespace.push.configuration.uriSuffix || '');
}

also I found in other place

ice.push.configuration.contextPath = 'something';

So, I wonder, how these assignments relate? Does ‘namespace’ identifier have special meaning? Or it is just a name like ‘ice’?

Thanks

UPDATE

People saying that ‘namespace’ means nothing special.

But I am trying to set ‘namespace.push.configuration.uriPrefix’ as I see it in Firebug debugger. First it was ” and was need it to contain some path. Initially I have assigned

namespace.push.configuration.uriPrefix = ice.push.configuration.contextPath + '/';

but it was remanining empty.

Then I tried to assign

ice.push.configuration.uriPrefix = ice.push.configuration.contextPath + '/';

and have ‘namespace.push.configuration.uriPrefix’ filled!

How can it be if ‘namespace’ have no special meaning???

UPDATE 2

May be they did some overloading? The overal structure of their script looks like the following

if (!window.ice) {
    window.ice = new Object;
}  
if (!window.ice.icepush) {

    (function(namespace) {

        window.ice.icepush = true;

        //....
        // a lot of functions
        // ....

     })(window.ice);
 }

everywhere in the functions ‘namespace’ is used and never it is spelled as ‘ice’.

Can this patterd do some overloading of ‘namespace’ variable?

  • 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-27T00:09:00+00:00Added an answer on May 27, 2026 at 12:09 am

    Seeing as I can’t comment on your original question, I’ll put this here.

    There area two main ways of setting up a name space, Objects { } and Functions (like above)

    What they are doing is just wrapping all of their code in an anonymous function and then calling it (this sets the scope or the namespace)

    ( function(variable) {  
        /* Code to execute using 'variable' */ 
    } )(item_to_fill_variable) 
    

    Which is basically the same as:

    function withNameSpace( namespace ) { 
        /* Code to execute using 'namespace' */ 
    }
    withNameSpace( window.ice );
    

    This sets (in your example) “namespace” to “window.ice”

    Now while inside of the anonymous function, you can use “namespace” to access “window.ice”.

    When outside of the anonymous function, “namespace” will be undefined and you wont be able to set it. This is more than likely what you were doing when trying to set namespace.push.configuration.uriPrefix = ice.push.configuration.contextPath + '/';

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

Sidebar

Related Questions

I've found the following JavaScript code on Google Chart Tools : function drawVisualization() {
In another question answered here I found the following JavaScript code: function _dom_trackActiveElement(evt) {
The following javascript code concatenates the matches found by a regular expression. The regular
While debugging a javascript code that uses jQuery I found the following code: [0,
I found the following piece of JavaScript code (maybe here at Stack Overflow?) for
Following is my JavaScript (mootools) code: $('orderNowForm').addEvent('submit', function (event) { event.preventDefault(); allFilled = false;
Going through Javascript documentation, I found the following two functions on a Javascript object
I found the following code to create a tinyurl.com url: http://tinyurl.com/api-create.php?url=http://myurl.com This will automatically
I found the following code somewhere, but I am not understanding the code properly.
I found the following code to decode a ROT13 string and put it into

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.