B
boanator
I am trying to use ajax to load a page that has a <form> element.
Here is my problem: if the page being loaded has a <form> element, it
will only work in Internet Explorer. In Netscape, anything that is
inside the <form> element will not be loaded into my main page.
Has anyone had this problem? I would greatly appreciate any advice or
information that will lead me to a solution.
The following is a basic example of how I load the page:
<html>
....
<script>
var httpRequest;
function loadPage() {
var url = "formTest.jsp"
if (window.ActiveXObject) {
httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
} else {
httpRequest = new XMLHttpRequest();
}
httpRequest.opem("GET", url, true);
httpRequest.onreadystatechange = function() {processRequest(); };
httpRequest.send(null);
}
function processRequest() {
if (httpRequest.readyState == 4) {
var contentViewer = document.getElementById("contentViewer");
if (httpRequest.status == 200) {
contentViewer.innerHTML = httpRequest.responseText;
} else {
contentViewer.innerHTML = "Error: cannot load page...";
}
}
....
</script>
....
</html>
Thanks in advance.
Here is my problem: if the page being loaded has a <form> element, it
will only work in Internet Explorer. In Netscape, anything that is
inside the <form> element will not be loaded into my main page.
Has anyone had this problem? I would greatly appreciate any advice or
information that will lead me to a solution.
The following is a basic example of how I load the page:
<html>
....
<script>
var httpRequest;
function loadPage() {
var url = "formTest.jsp"
if (window.ActiveXObject) {
httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
} else {
httpRequest = new XMLHttpRequest();
}
httpRequest.opem("GET", url, true);
httpRequest.onreadystatechange = function() {processRequest(); };
httpRequest.send(null);
}
function processRequest() {
if (httpRequest.readyState == 4) {
var contentViewer = document.getElementById("contentViewer");
if (httpRequest.status == 200) {
contentViewer.innerHTML = httpRequest.responseText;
} else {
contentViewer.innerHTML = "Error: cannot load page...";
}
}
....
</script>
....
</html>
Thanks in advance.