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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:44:41+00:00 2026-05-26T05:44:41+00:00

I want an array of objects to monitor (loading of) each span element (using

  • 0

I want an array of objects to monitor (loading of) each span element (using XMLHTTPRequest to retrieve a URL on another page and place into the relevant span – I haven’t included this functionality below as I’m only interested in the object array).

I liked the idea of the following (Doug Crockford?) snippet, but I just can’t get it to work. I get:

URLLoad.LoadingTxt000003.SetLoadTimeout is not a function

Any ideas?

Here’s my code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>

<script language="javascript" type="text/javascript">

function URLLoad(id) {
    alert(id);

    return URLLoad[id] = {
        Tagid:id,
        LoadTimeout:0
    }
}

URLLoad.prototype.SetLoadTimeout = function(lt) {
    this.LoadTimeout = lt;
}

URLLoad("LoadingTxt000003");
URLLoad("LoadingTxt000005");

alert(URLLoad.LoadingTxt000003.DelayTimeout + URLLoad.LoadingTxt000005.DelayTimeout);

URLLoad['LoadingTxt000003'].SetLoadTimeout(20); //doesn't work
URLLoad.LoadingTxt000003.SetLoadTimeout(20);    //doesn't work

</script>

</head>

<body>

    <span id="LoadingTxt000003">...</span>
    <span id="LoadingTxt000005">...</span>

</body>
</html>
  • 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-26T05:44:41+00:00Added an answer on May 26, 2026 at 5:44 am

    In order to have prototypical inheritance work you need to do two things:

    1. Use the new operator when creating the object, in order to have a this with the correct prototype.

      new URLLoad(...)
      
    2. Not return a value from the constructor. The value you are returning doesn’t have the correct prototype but has precedence anyway.

      function URLLoad(){
          this.tagId = ...;
          this.timeOut = ...;
      }
      

    Of course you might now complain that I am not doing the cacheing. Well, I think it is best to separate the construction from the cacheing.

    var cache = {};
    function urlLoad(key){
        if(!cache[key]){ cache[key] = new URLLoad(key); }
        return cache[key];
    }
    

    If you want to avoid having those exposed cache and URLLoad globals, we can make them private with the module pattern:

    var urlLoad = (function(){
    
        function URLLoad(){...};
        URLLoad.prototype = {...};
    
        var cache = {};
        function urlLoad(){...};
    
        return urlLoad;
    }()); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create in C++ an array of Objects without using STL. How
I have an array of objects and I want to add another object just
I want to display array objects from one view controller to another view controller's
I have an array with objects, I want to save each one of them
I have an array of objects and I want to concatenate it with another
I have a 2-dimensional array of objects and I basically want to databind each
I want to send array of my own objects to JSP page by request.
I have an array of objects and I want to find which element in
I want to show array objects at the same time in different 10 labels.
I want to create an array of objects, so what I did was to

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.