SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Threaded View

  1. #1
    SitePoint Wizard
    Join Date
    Oct 2005
    0 Post(s)
    0 Thread(s)

    how to enter values in to this array?


    I have this bit of code:

    Code JavaScript:
     var IdContainer = new Array();
         for(i=0; i < SEARCHNO; ++i) {
         	var  search_ID = xmlDoc.getElementsByTagName("searchID")[i];
       	  var SEARCHID = search_ID.firstChild.nodeValue;
       	  if(SEARCHID !== IDCONTAINER) {
      code to add the SEARCHID to the IDCONTAINER array here

    Now what i want it to do is every time the for loop runs the if statement checks whether the SEARCHID variable is not equal to the values in the IDCONTAINER array....if this is the case then the code after the if is run and the value in the SEARCHID variable is added to the IDCONTAINER array.

    Problem is i dont know how to structure the if statement to check all the values in the array against the SEARCHID and then i dont know how to update the array afetr the if with the new SEARCHID.

    any ideas on how to do this?

    Last edited by elduderino; Jul 1, 2007 at 06:07.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts