473,387 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Javascript combo loading problem

The following is the code i used to load a combo using javascript

Expand|Select|Wrap|Line Numbers
  1. xmlDoc=document.implementation.createDocument("","",null);
  2.     xmlDoc.async="false";xmlDoc.preserveWhiteSpace=true;
  3.     isLoaded=xmlDoc.load(file1);
  4.     alert(isLoaded);
  5.     if (isLoaded == true) { alert(xmlDoc.innerHTML);var doc = xmlDoc.getElementsByTagName('CATEGORY');}
  6.     for(i = 0;i < doc.length;i++)
  7.     { 
  8.       combo.options[i+1]=new Option(doc[i].getAttribute('CATNAME'),doc[i].getAttribute('CATCODE'),false,false);
  9.     }
  10.  
in firefox if we uncomment the line alert(isLoaded); the script won't work.Otherwise it works fine if we click on that alertbox. Please help me .
Aug 21 '08 #1
1 1119
RamananKalirajan
608 512MB
Hi dude, the problem with the code is doc.length returns 0, so only the for loop is not working. I am trying with ur code can u please post the xml u created. Because I hard cored one xml and i worked on that. Please post the XML. I will try to help u out

Regards
Ramanan Kalirajan
Aug 21 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Roy Wang | last post by:
hi, My problem is how to determining when the XML file has loaded using javascript. I loaded an xml file using javascript in a web page. The code below is loading the xml file for IE:...
0
by: Krisa | last post by:
Hello all, I just discovered something (stop me if you've heard this before....) that was causing me a significant performance hit when opening a form with subforms. To speed up loading the...
3
by: B | last post by:
I know there are several ways to speed up combo boxes and form loading. Most of the solutions leave rowsource of the combo box blank and set the rowsource to a saved query or an SQL with a where...
3
by: NB | last post by:
Let's say in the product table I have around 50,000 products (well, infact it has now about 2000 only, but it's growing very fast, hence the question here) In the order form, users will select...
2
by: Stropher | last post by:
Hi! I've just written a form. In this form, I extract some data from the db for a given combobox when loading the form. The problem is this, when I fail to select an item from this combobox and...
10
by: Richard | last post by:
I have created a form which sets up a dataview. The form views one record at a time using a currencymanager. This works fine. All my text boxes bind. However I have a combo box which gets its...
1
by: ozzy.osborn | last post by:
Hello All, I have been struggling with a cross browser solution to loading external javascript files on the fly. I have been successful using the following code in IE6: var newScr =...
2
by: Ausclad | last post by:
Hi, I have a combo box that I want to populate, based on the selection of another combo box. So when combo box A is selected, combo box B is populated with related values. I have this all...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.