Forum Moderators: open

Message Too Old, No Replies

Ajax troubles, and arrays.

trying to make the data that i'm retrieving with ajax into a JS array

         

supermanjnk

1:11 am on Dec 1, 2005 (gmt 0)

10+ Year Member



I have the following code

var result = new Array;
result[0] = http_request.responseText;

the data in: http_request.responseText;
is currently two values pulled via php, I need a way to make it so that these are in two seperate arrays because they appear it two different sections. Is it better to just repost the whole section, or is what i'm trying to do possible?

Currently it is seeing the text in : http_request.responseText; as text, and not as code. and I have no idea how to make it appear as code, or how the best way to proceed is.

ajkimoto

3:20 pm on Dec 8, 2005 (gmt 0)

10+ Year Member



supermanjnk,

You should be able to access whatever nodes of the XML that you want using something like:

myArray[0]=http_request.responseXML.getElementsByTagName("nodename")[0];

You can use the normal childNodes, firstChild, etc. to access different parts of the XML tree.

Hope this helps,

ajkimoto