Ajax : how to get xml value

Hi,

I have a code. I want to get value of username ->“test”, I saw the doc and sample and forum, it can not same topic.

Could you help this problem.

thank you very much.

code

dhtmlxAjax.get("php/getUsername.php?user_id="+value1);
<scopes>
<GET>
<param0>
<param1 name="userName">test</param1>
</param0>
</GET>
</scopes>

Hi

dhx4.ajax.get("1.xml", function(r){ r = r.xmlDoc.responseXML; // will give you DOM object console.log(r.firstChild.tagName); });

Hi,

Thanks for your reply.

If I have 2 question on it , could you give me some suggestion.

  1. r.firstChild.tagName => how to use this , r.firstChild.tagName(“param1”) or r.firstChild.param1 or…
  2. I want to use alert show the data , how to describe on it : alert( r.firstChild.tagName(“param1”) );

Many thanks ,

Kenneth Cho

Hi ,

It can show the tagName, I want to show :

<param1 name="userName">test</param1>

the value is “test”.

but it just show “param0” , this is not I want to show the data.

please help.

thanks again.

Kenneth Cho

Hi ,
solved .

the value can receive .

the answer is
alert(r.firstChild.childNodes[0].nodeValue);

Many thanks again.

Kenneth