'XmlHttpRequest.responseText result?

I am new to JavaScript. I need to test the output of XMLHttpRequest.responseText on a given URL. What is the simplest way to do it?

var url = "http://m.google.com/"; <br>
var xmlHttp = new XMLHttpRequest(); <br>
xmlHttp.open('GET', url, true); <br>
document.getElementById('main-content').innerHTML = xmlHttp.responseText; <br>

main-content is a <div> tag. The last line of code will replace the contents of the <div> tag with output of xmlHttp.responseText.

Now, when I open m.google.com in my regular browse and select "View Source", what part of the source gets placed within the <div> tag. Or let's stay I have to test this code in - where do I write this code?

Actually, I have an Android app that displays this HTML code result in a WebView.



Solution 1:[1]

Get Firefox with Firebug and browse XMLHttpRequest object for responseText member.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Daniel Protopopov