I need to a help regarding Ajax and HTML .?

Origins

New member
well I need to get text from specific id when I click on the button by using Ajax

so the following file stored on the server

file.text
-------------
<html><body>
<p id='name1'>
Ultragunner
</p>
<p id='name2'>
Zulwarn
</p>
<p id='name2'>
Ruby
</p>
</body></html>

<p id='name3'>
Sapphire
</p>


<p id='name4'>
Jeewantha
</p>

and when I make a request to that page by AJAX then obviously I can get all texts
by using .responseText ; property but in this case I need to get specific text in given id name
so how do I do that I tried use getElementById('name1') method after all texts got from the server but it doesn't work and IE said there is no such an id

if I can't make this work then it will be a big trouble because then I need to make lot of files for each text I guess it may easy with XML but I don't know that so please help me :D

thanks
 
Back
Top