Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to see the data content sending back from server using jQuery ajax
    primarykey
    data
    text
    <p>Main.php</p> <pre><code> &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Lesson 21: Easy AJAX Calls with jQuery&lt;/title&gt; &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.7.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;Lesson 21: Easy AJAX Calls with jQuery load()&lt;/h1&gt; &lt;p&gt;&lt;a href="#"&gt;Click here to fetch HTML content&lt;/a&gt;&lt;/p&gt; &lt;div id="result"&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { var url = "lesson18_test.xml"; function processData(data) { var resultStr = ""; var items = $(data).find('language'); $(items).each(function(i) { resultStr += $(this).text() + '&lt;br /&gt;'; $('#result').html(resultStr); }); } $('a').click(function() { $.get(url, processData); }); }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>lesson18_test.xml</p> <pre><code>&lt;?xml version="1.0" ?&gt; &lt;languages&gt; &lt;language&gt;PHP&lt;/language&gt; &lt;language&gt;Ruby On Rails&lt;/language&gt; &lt;language&gt;C#&lt;/language&gt; &lt;language&gt;JavaScript&lt;/language&gt; &lt;/languages&gt; </code></pre> <p>Above code is from one tutorial here: <a href="http://www.html.net/tutorials/javascript/lesson21.php" rel="nofollow">http://www.html.net/tutorials/javascript/lesson21.php</a></p> <p>Question:</p> <p>Is there a way that i can see the content in data? I tried <code>alert(data)</code>, it only shows ' object XMLobject'. I know inside data is the lesson18_test.xml, but just want to see how it structured in data. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload