?
Solved

Javascript - array of XmlHttpRequest objects

Posted on 2009-02-12
4
Medium Priority
?
704 Views
Last Modified: 2012-05-06
I've got an application that builds block of javascript code dynamically and then adds it to the page.  The code that is built dynamically is...

<script>var XHRList = new Array();XHRList[0] = CreateXmlHttpRequestObject();XHRList[1] = CreateXmlHttpRequestObject();XHRList[2] = CreateXmlHttpRequestObject();XHRList[3] = CreateXmlHttpRequestObject();XHRList[4] = CreateXmlHttpRequestObject();XHRList[5] = CreateXmlHttpRequestObject();XHRList[6] = CreateXmlHttpRequestObject();</script>

The javascript function CreateXmlHttpRequestObject() is already part of the page that the above code is being added to and I have verified that it does return an XmlHttpRequest object.  Yet, when the page starts to run the above block of code that is trying to create an array of XmlHttpRequest objects, I'm getting an error on the first saying "Object Expected".

Do I have to do something special to stick these objects inside of an array?
0
Comment
Question by:josephdaviskcrm
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
quincydude earned 2000 total points
ID: 23628684
can u show us your CreateXmlHttpRequestObject() ?
0
 
LVL 29

Expert Comment

by:Badotz
ID: 23630784
<$.02>And for heaven's sake, use a little whitespace.</$.02>
0
 

Author Comment

by:josephdaviskcrm
ID: 23637781
nevermind... I figured it out on my own.
0
 
LVL 29

Expert Comment

by:Badotz
ID: 23637848
Show us what you did, please.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question