I am new to web programming.Previously I worked in java module.I want to get http response by hitting particular url.I am looking in w3c schools and I am trying still no result.please help me I want to full webpage source.
code:
<html>
<head>
<script src="jquery.js">
</script>
<script>
var response = '';
$.ajax({ type: "GET",
url: "http://www.google.com",
async: false,
success : function(text)
{
response = text;
}
});
alert(response);
</script>
</head>
<body>
<input type="button" value="submit" />
<p>hello how are you </p>
</body>
</html>
responsedoesn't exist out the ajax call, you need to use it insice desuccesscall event.