jquery - Set AJAX dataType using Vanilla javascript? -


मैं इस तरह से कुछ AJAX का उपयोग कर रहा हूं:

  xmlhttp = new XMLHttpRequest (); xmlhttp.open ( "GET", "http://example.com", झूठी); xmlhttp.send (); डेटा = xmlhttp.responseXML;   

XMLhttp.responseXML XML में वापस आ गया है, इसलिए यह एक जावास्क्रिप्ट ऑब्जेक्ट है। हालांकि, मैं इसे कच्चे स्ट्रिंग प्रारूप में पसंद करूंगा। JQuery के $। Ajax ()

डेटा प्रकार: "टेक्स्ट" Itemprop = "text">

responseText का उपयोग करें responseXML

  xmlhttp = new XMLHttpRequest () के बजाय करें; xmlhttp.open ( "GET", "http://example.com", झूठी); xmlhttp.send (); डेटा = xmlhttp.responseText;    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -