# Other Programming > AJAX >  [RESOLVED] XML to Javascript - Conversion of response.

## 92968

results from getpost.php

<response>
<journalID>4</journalID>
<accountID>1</accountID>
<title>testtest</title>
<content>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sapien nisl, convallis vitae sodales sed, convallis eu nunc. Donec sem libero, semper non tempor non, tincidunt non dui. Phasellus tempus, est quis congue posuere, dolor enim ultricies lectus, ullamcorper porttitor sem nisl eu justo. Morbi ultricies porttitor odio ut eleifend. Integer gravida convallis laoreet. Proin scelerisque, libero sed varius venenatis, turpis nisi malesuada tortor, ac fermentum quam est eu est. Integer semper pellentesque magna, eu molestie tellus porta viverra. Quisque pellentesque fermentum quam et mattis. Praesent lacinia fringilla ipsum, quis rhoncus turpis tristique nec. Donec mollis euismod lacinia. Vestibulum nulla ligula, volutpat nec tincidunt eget, convallis sed ante.
</content>
<datetime>2013-05-12 16:23:56</datetime>
</response>

How do I convert this to be able to use it in my javascript?
I need it to be in array form or at least in individual variables.

Sincerely yours,
D

----------


## the_cat

Check out this article on parsing XML in JavaScript. http://www.w3schools.com/xml/xml_parser.asp
jQuery natively, and through various plug-ins, supports XML and makes it easy to access and analyse.

----------


## uma2712

Find the script for XML to Array conversion using jquery, Ajax :






> <script>
> 	$().ready(function() {
> 		$("#getXmlRes").click(function(event) {
> 			$.ajax ({
> 				url: "./xml/response.xml"
> 			});
> 		});
> 
> 		$(document).ajaxComplete(function(event, response, ajaxOptions) {
> ...




Hope this will help you..

----------

