M
mflll
I am having trouble getting my simple AJAX program to work at my
current
University. Here is one of the programs that is giving problems. I
tried
it in and Mozilla/5.0 Gecko/20050923 under Fedora Linux
I see the alert's "V" and "V Two" The latter says
"null[XMLHttpRequest} aitivie sob ject undefined"
so I know that it retrieving the XMLHttpRequest object from the system.
It hangs after that; that is, I don't see "here get" alert.
Needless, to say, I confirmed with browser that the URL was available.
Thanks for any help you can provide. My students and myself were
excited
about doing AJAX in my Graphical User Interface class. I got it to
work
at another University when I was staying in another city, see below.
Thus, I was surprised and disappointed that it won't work here.
Dr. Laurence Leff, Pager 309 367 0787
Associate Professor of Computer Science, 1 University Circle
Western Illinois University Macomb IL 61455
<html>
<head>
<SCRIPT LANGUAGE="JavaScript" >
var HO;
document.write("Testingasdf");
function getRequestObject (){
xmlhttp = new XMLHttpRequest();
alert ("null" + window.XMLHttpRequest + " acitvie sob ject " +
window.ActiveXObject);
return xmlhttp ;
}
function Q () {
var code = HO.readyState;
alert (HO.readyState);
if (code == 4) {
alert ("code four")
var MyDocument = HO.responseXML;
var XXNode = MyDocument.getElementsByTagName('xx');
var YYNode = MyDocument.getElementsByTagName('yy');
xx = XXNode[0].firstChild.data;
yy = YYNode[0].firstChild.data;
document.QQ.xxReceive.value = xx;
document.QQ.yyReceive.value = yy;
}
}
function V () {
alert("v");
HO = getRequestObject();
alert ("V Two" + HO);
Hpen("GET","http://www.wiu.edu/users/mflll/U.xml");
alert ("here get" + HO+"|" );
Hnreadystatechange=Q;
alert (" ho onready statechange")
HO.send(null);
}
</script>
</HEAD>
<BODY>
<P>
Text before Form
<P>
<form name="QQ" >
<input TYPE = "BUTTON" NAME="qq" VALUE="PressMe"
onClick="V()" />
<input TYPE="text" name="xxReceive"/>
<INPUT TYPE="text" name="yyReceive"/>
</form>
</BODY>
The program below worked under an older version of internet explorer
at another University near where I was staying with my mother that let
me use
their computer as a courtesy.
It does not work now under a more current version of Internet Explorer.
<html>
<head>
<SCRIPT LANGUAGE="JavaScript" >
var HO;
document.write("Testingd");
function getRequestObject (){
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (E) {
alert ("second catch");
}
}
return xmlhttp ;
}
function Q () {
var code = HO.readyState;
alert (HO.readyState);
if (code == 4) {
alert ("code four")
var MyDocument = HO.responseXML;
var XXNode = MyDocument.getElementsByTagName('xx');
var YYNode = MyDocument.getElementsByTagName('yy');
xx = XXNode[0].firstChild.data;
yy = YYNode[0].firstChild.data;
document.QQ.xxReceive.value = xx;
document.QQ.yyReceive.value = yy;
}
}
function V () {
alert("v");
HO = getRequestObject();
Hpen("GET","http://www.wiu.edu/users/mflll/U.xml");
alert ("here get")
Hnreadystatechange=Q;
alert (" ho onready statechange")
HO.send(null);
}
</script>
</HEAD>
<BODY>
<P>
Text before Form
<P>
<form name="QQ" >
<input TYPE = "BUTTON" NAME="qq" VALUE="PressMe"
onClick="V()" />
<input TYPE="text" name="xxReceive"/>
<INPUT TYPE="text" name="yyReceive"/>
</form>
</BODY>
current
University. Here is one of the programs that is giving problems. I
tried
it in and Mozilla/5.0 Gecko/20050923 under Fedora Linux
I see the alert's "V" and "V Two" The latter says
"null[XMLHttpRequest} aitivie sob ject undefined"
so I know that it retrieving the XMLHttpRequest object from the system.
It hangs after that; that is, I don't see "here get" alert.
Needless, to say, I confirmed with browser that the URL was available.
Thanks for any help you can provide. My students and myself were
excited
about doing AJAX in my Graphical User Interface class. I got it to
work
at another University when I was staying in another city, see below.
Thus, I was surprised and disappointed that it won't work here.
Dr. Laurence Leff, Pager 309 367 0787
Associate Professor of Computer Science, 1 University Circle
Western Illinois University Macomb IL 61455
<html>
<head>
<SCRIPT LANGUAGE="JavaScript" >
var HO;
document.write("Testingasdf");
function getRequestObject (){
xmlhttp = new XMLHttpRequest();
alert ("null" + window.XMLHttpRequest + " acitvie sob ject " +
window.ActiveXObject);
return xmlhttp ;
}
function Q () {
var code = HO.readyState;
alert (HO.readyState);
if (code == 4) {
alert ("code four")
var MyDocument = HO.responseXML;
var XXNode = MyDocument.getElementsByTagName('xx');
var YYNode = MyDocument.getElementsByTagName('yy');
xx = XXNode[0].firstChild.data;
yy = YYNode[0].firstChild.data;
document.QQ.xxReceive.value = xx;
document.QQ.yyReceive.value = yy;
}
}
function V () {
alert("v");
HO = getRequestObject();
alert ("V Two" + HO);
Hpen("GET","http://www.wiu.edu/users/mflll/U.xml");
alert ("here get" + HO+"|" );
Hnreadystatechange=Q;
alert (" ho onready statechange")
HO.send(null);
}
</script>
</HEAD>
<BODY>
<P>
Text before Form
<P>
<form name="QQ" >
<input TYPE = "BUTTON" NAME="qq" VALUE="PressMe"
onClick="V()" />
<input TYPE="text" name="xxReceive"/>
<INPUT TYPE="text" name="yyReceive"/>
</form>
</BODY>
The program below worked under an older version of internet explorer
at another University near where I was staying with my mother that let
me use
their computer as a courtesy.
It does not work now under a more current version of Internet Explorer.
<html>
<head>
<SCRIPT LANGUAGE="JavaScript" >
var HO;
document.write("Testingd");
function getRequestObject (){
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (E) {
alert ("second catch");
}
}
return xmlhttp ;
}
function Q () {
var code = HO.readyState;
alert (HO.readyState);
if (code == 4) {
alert ("code four")
var MyDocument = HO.responseXML;
var XXNode = MyDocument.getElementsByTagName('xx');
var YYNode = MyDocument.getElementsByTagName('yy');
xx = XXNode[0].firstChild.data;
yy = YYNode[0].firstChild.data;
document.QQ.xxReceive.value = xx;
document.QQ.yyReceive.value = yy;
}
}
function V () {
alert("v");
HO = getRequestObject();
Hpen("GET","http://www.wiu.edu/users/mflll/U.xml");
alert ("here get")
Hnreadystatechange=Q;
alert (" ho onready statechange")
HO.send(null);
}
</script>
</HEAD>
<BODY>
<P>
Text before Form
<P>
<form name="QQ" >
<input TYPE = "BUTTON" NAME="qq" VALUE="PressMe"
onClick="V()" />
<input TYPE="text" name="xxReceive"/>
<INPUT TYPE="text" name="yyReceive"/>
</form>
</BODY>