assigning ajax response length to a var by jquery - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:ajax

Description

assigning ajax response length to a var by jquery

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-compat-git.js"></script> 
  <script type="text/javascript">
    $(window).on('load', function() {
xml = "<?xml version='1.0' encoding='utf-8'?><error>test.</error>";
xmlDoc = $.parseXML( xml );
window.alert($('error:eq(0)', xmlDoc).text());
    });/*from w  w w.jav  a2  s . com*/

      </script> 
 </head> 
 <body>  
 </body>
</html>

Related Tutorials