Hi, I have an asp page which is called with ajax. It correctly replies with an xml tree. THis tree has:
<studentList>
<student>
<id>1</id>
<name>Tony1</name>
</student>
<student>
<id>2</id>
<name>Tony2</name>
</student>
<student>
<id>3</id>
<name>Tony3</name>
</student>
<student>
<id>4</id>
<name>Tony4</name>
</student>
</studentList>
The question is how do i get the data seperated. For example. I am using:
FirstName = $.trim( $( data ).find( ('name') ).text() );
$("#firstname1").attr("value", FirstName);
With this, the input field is taking the value "Tony1Tony2Tony3Tony4".... I just want it to be "Tony1". Is ther not a $( data ).find( ('name')[1] ).text() way of doing it?
<studentList>
<student>
<id>1</id>
<name>Tony1</name>
</student>
<student>
<id>2</id>
<name>Tony2</name>
</student>
<student>
<id>3</id>
<name>Tony3</name>
</student>
<student>
<id>4</id>
<name>Tony4</name>
</student>
</studentList>
The question is how do i get the data seperated. For example. I am using:
FirstName = $.trim( $( data ).find( ('name') ).text() );
$("#firstname1").attr("value", FirstName);
With this, the input field is taking the value "Tony1Tony2Tony3Tony4".... I just want it to be "Tony1". Is ther not a $( data ).find( ('name')[1] ).text() way of doing it?