Google API and XHR request

Google api: http://code.google.com/apis/ajax/playground/

XHR request:

function loadXMLDoc(url)
{
        if (window.XMLHttpRequest)
        {// code for IE7+, Firefox, Chrome, Opera, Safari
                jsonhttp=new XMLHttpRequest();
        }
        else
        {// code for IE6, IE5
                jsonhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        jsonhttp.open("GET",url,false);
        jsonhttp.send(null);
        document.write("Response from mysql:</br>");
        document.write(jsonhttp.responseText);
        return(JSON.parse(jsonhttp.responseText));
}
var result = loadXMLDoc('the_request.php');
Scott Tse's Picture

About Scott Tse

Discover and Exploit.

Hong Kong, China https://www.scottietse.com

Comments