Read Data from XML BY JQUERY

 
There Is very few simple steps that we need to follow:

(1): Get the XML by jquery get method from specific location.

(2): Jquery Find Method to find specific element from XML.

 
   <script type="text/javascript">
 
       $(document).ready(function() {
           $.get('Data.xml', function(d) {
               var data = "";
               var startTag = "<table border='1' id='mainTable'><tbody><tr><td style=\"width: 120px\">Name</td><td style=\"width: 120px\">Link</td></tr>";
               var endTag = "</tbody></table>";
               $(d).find('url').each(function() {
                   var $url = $(this);
                   var link = $url.find('link').text();
                   var name = $url.find('name').text();
                   data += '<tr><td>' + name + '</td>';
                   data += '<td>' + link + '</td></tr>';
               })
               $("#content").html(startTag + data + endTag);
               ;
           });
 
       });
   </script>

The result will display in Html table format according to tag.See the below screen short:

Author: Pavan

I am asp.net developer have good knowledge of Asp.net ver 05,08,10 and good hand in sql server.Proficient in Object Oriented Programming and javascript, jQuery. Achievements - Integrate Spotfire, appnexus API ASP.net with sql server. Hobbies - Blogging ,Games, Movies ,Teaching,Keeping myself update with new technologies