Witam,
od kilku chwil spróbuję napisać mały skrypt, który pobierze kod html wybranej strony przeze mnie.
Korzystając z $.get() otrzymuje puste dane. W momencie gdy wpisze np. index.html wszystko jest ok.
Gdzie może być problem?
<!DOCTYPE html>
<html lang="pl">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#go').click(function()
{
var url = $('#url').val();
$.get(url, function(data)
{
alert("Data Loaded: " + data);
});
});
return false;
});
</script>
</head>
<body>
<input id="url" value="www.google.com"/>
<input id="go" type="submit" />
</body>
</html>