H
Haris Bogdanovic
Hi.
I have a page like this:
---------------------------------------------------------------------------
<html>
<head>
<script type='text/javascript'>
function xhrFunc() {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
alert(xhr.responseText);
};
return 0;
};
xhr.open('GET', 'test', true);
xhr.send(null);
return 0;
};
</script>
</head>
<html>
<p onclick='xhrFunc();'>
xhr
</p>
</html>
</html>
--------------------------------------------------------------------------
Whenever I click on "xhr" I get a messagge box with the
source code of this page.
Why the responseText property returns that instead of something from "test"
page ?
Thanks
I have a page like this:
---------------------------------------------------------------------------
<html>
<head>
<script type='text/javascript'>
function xhrFunc() {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
alert(xhr.responseText);
};
return 0;
};
xhr.open('GET', 'test', true);
xhr.send(null);
return 0;
};
</script>
</head>
<html>
<p onclick='xhrFunc();'>
xhr
</p>
</html>
</html>
--------------------------------------------------------------------------
Whenever I click on "xhr" I get a messagge box with the
source code of this page.
Why the responseText property returns that instead of something from "test"
page ?
Thanks