473,403 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

help! I dont have IE6 and apparently it aint working

Hi Folk

Can you please have a look at http://www.friars.co.nz/map.php and let
me know if the map is working on IE6 (just do a simple search).
Unfortunately, I do not have IE6 anymore and so I can not test it.

I think there maybe some trouble with retrieving the AJAX xml. Below
is the code for this:

var i = new Array();
var j = 0;
var jmax = 4;
var http_request = false;
Thanks a million

Nicolaas

//------------------------------------ Main functions
//main function to chang the map
function changemap() {
var variables = getformparameters(document.getElementById('mapform '),
'')+ "&h=1&k=1&l=1&m=1";
var onready = "updatemap";
UpdateHtml('_GSmap.php', 'GSmaptype=8' + variables, onready);
//initMapGSmap();
createGSlayer('GSmaptype=1' + variables);
//reset
j = 0;
i = new Array();

return true;
}

// run a search (prior to updating the map)
function getsearchdata() {
var variables = getformparameters(document.getElementById('sea'), '');
variables = variables + "&map=1";
var el = document.getElementById('c2');
el.checked = true;
var el = document.getElementById('syes');
el.checked = true;
var onready = "updatesearchresults";
var url = "searcher.php";
UpdateHtml(url, variables, onready);
return true;
}

//------------------------------------ FORM interaction

//gets all variables from a form
function getformparameters(obj, getstr) {
j++;
for (i[j]=0; i[j] < obj.childNodes.length; i[j]++) {
var newobj = obj.childNodes[i[j]];
tgname = newobj.tagName
if(tgname) {
tgname.toLowerCase;
if (tgname == "INPUT") {
var tvalue = newobj.value;
if(tvalue != 0 && tvalue != "") {
var ttype = newobj.type;
var tname = newobj.name;
if (ttype == "text") {
getstr += "&" + tname + "=" + tvalue ;
}
if (ttype == "checkbox") {
if (newobj.checked) {
getstr += "&" + tname + "=" + tvalue;
}
else {
getstr += "&" + tname + "=0";
}
}
if (ttype == "radio") {
if (newobj.checked) {
getstr += "&" + tname + "=" + tvalue;
}
}
}
}
if (tgname == "SELECT") {
var sel = newobj;
var tvalue = sel.options[sel.selectedIndex].value;
if(tvalue != 0 && tvalue != "") {
getstr += "&" + sel.name + "=" + tvalue;
}
}
}
if(newobj.childNodes.length 0 && j < jmax) {
getstr = getformparameters(newobj, getstr);
}
}

j--;
return getstr;
}

//------------------------------------ AJAX STARTER
//open xml sheet on the server and specify the function to run when the
xml is loaded
function UpdateHtml(url, parameters, onready) {
http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
// set type accordingly to anticipated content type
http_request.overrideMimeType('text/xml');
//http_request.overrideMimeType('text/html');
}
}
else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {
alert('could not load data');
}
}
}
if (!http_request) {
alert('Cannot create XMLHTTP instance');
return false;
}
if(onready == "updatemap") {
http_request.onreadystatechange = updatemap;
}
else {
http_request.onreadystatechange = updatesearchresults;
}
var geturl = url + '?' + parameters;
document.getElementById(idname + 'title').innerHTML = "loading new map
.... "; //+ geturl;
http_request.open('GET', geturl, true);
http_request.async = false;
http_request.send(null);
}

// -------------- process XML ----------------------------
//process map data
function updatemap() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
//alert(http_request.responseText);
var xmlDoc = http_request.responseXML;
var titlearray = xmlDoc.getElementsByTagName('title');
var infoarray = xmlDoc.getElementsByTagName('info');
var zoomarray = xmlDoc.getElementsByTagName('zoom');
var longitudearray = xmlDoc.getElementsByTagName('longitude');
var lattitudearray = xmlDoc.getElementsByTagName('lattitude');
var info = serializeNode(infoarray[0]);
var a = lattitudearray[0].firstChild.nodeValue;
var o = longitudearray[0].firstChild.nodeValue;
var z = zoomarray[0].firstChild.nodeValue;
if(document.getElementById(idname + 'title')) {
document.getElementById(idname + 'title').innerHTML =
titlearray[0].firstChild.nodeValue;
}
if (document.getElementById(idname + 'info') && 1 == 2) {
document.getElementById(idname + 'info').innerHTML = info;
}
if(document.getElementById('outerinfo')) {
document.getElementById('outerinfo').innerHTML = '' + info + '';
}
GSrezoom(o,a,z);
}
else {
alert('There was a problem with the request.');
}
}
else {

}
}

//process search results
function updatesearchresults() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
var xmlDoc = http_request.responseXML;
var humansqlarray = xmlDoc.getElementsByTagName('humansql');
var humansql = serializeNode(humansqlarray[0]);
document.getElementById('humansql').innerHTML = humansql;
changemap();
}
else {
alert('There was a problem with the request.');
}
}
}

// -------------- XML details ----------------------------
//retrieve data from XML sheet
function serializeNode(node) {
if(node != undefined) {
var xml = "";
if(_browser.isSafari) {
xml = xmlText(node);
}
else if(_browser.isIE) {
xml = node.xml;
}
else {
var serializer = new XMLSerializer();
xml = serializer.serializeToString(node);
}
return xml;
}
else {
return undefined;
}
}

var DOM_ELEMENT_NODE = 1;
var DOM_TEXT_NODE = 3;
/**
* Returns the representation of a node as XML text.
*/
function xmlText(node) {
var ret = '';
if (node.nodeType == DOM_TEXT_NODE) {
ret += node.nodeValue;
}
else if (node.nodeType == DOM_ELEMENT_NODE) {
ret += '<' + node.nodeName;
for (var i = 0; i < node.attributes.length; ++i) {
var a = node.attributes[i];
if (a && a.nodeName && a.nodeValue) {
ret += ' ' + a.nodeName;
ret += '="' + a.nodeValue + '"';
}
}
if (node.childNodes.length == 0) {
ret += '/>';
}
else {
ret += '>';
for (var i = 0; i < node.childNodes.length; ++i) {
ret += arguments.callee(node.childNodes[i]);
}
ret += '</' + node.nodeName + '>';
}
}
return ret;
}

Dec 10 '06 #1
4 1405
Daz

windandwaves wrote:
Hi Folk

Can you please have a look at http://www.friars.co.nz/map.php and let
me know if the map is working on IE6 (just do a simple search).
Unfortunately, I do not have IE6 anymore and so I can not test it.

I think there maybe some trouble with retrieving the AJAX xml. Below
is the code for this:

var i = new Array();
var j = 0;
var jmax = 4;
var http_request = false;
Thanks a million

Nicolaas

//------------------------------------ Main functions
//main function to chang the map
function changemap() {
var variables = getformparameters(document.getElementById('mapform '),
'')+ "&h=1&k=1&l=1&m=1";
var onready = "updatemap";
UpdateHtml('_GSmap.php', 'GSmaptype=8' + variables, onready);
//initMapGSmap();
createGSlayer('GSmaptype=1' + variables);
//reset
j = 0;
i = new Array();

return true;
}

// run a search (prior to updating the map)
function getsearchdata() {
var variables = getformparameters(document.getElementById('sea'), '');
variables = variables + "&map=1";
var el = document.getElementById('c2');
el.checked = true;
var el = document.getElementById('syes');
el.checked = true;
var onready = "updatesearchresults";
var url = "searcher.php";
UpdateHtml(url, variables, onready);
return true;
}

//------------------------------------ FORM interaction

//gets all variables from a form
function getformparameters(obj, getstr) {
j++;
for (i[j]=0; i[j] < obj.childNodes.length; i[j]++) {
var newobj = obj.childNodes[i[j]];
tgname = newobj.tagName
if(tgname) {
tgname.toLowerCase;
if (tgname == "INPUT") {
var tvalue = newobj.value;
if(tvalue != 0 && tvalue != "") {
var ttype = newobj.type;
var tname = newobj.name;
if (ttype == "text") {
getstr += "&" + tname + "=" + tvalue ;
}
if (ttype == "checkbox") {
if (newobj.checked) {
getstr += "&" + tname + "=" + tvalue;
}
else {
getstr += "&" + tname + "=0";
}
}
if (ttype == "radio") {
if (newobj.checked) {
getstr += "&" + tname + "=" + tvalue;
}
}
}
}
if (tgname == "SELECT") {
var sel = newobj;
var tvalue = sel.options[sel.selectedIndex].value;
if(tvalue != 0 && tvalue != "") {
getstr += "&" + sel.name + "=" + tvalue;
}
}
}
if(newobj.childNodes.length 0 && j < jmax) {
getstr = getformparameters(newobj, getstr);
}
}

j--;
return getstr;
}

//------------------------------------ AJAX STARTER
//open xml sheet on the server and specify the function to run when the
xml is loaded
function UpdateHtml(url, parameters, onready) {
http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
// set type accordingly to anticipated content type
http_request.overrideMimeType('text/xml');
//http_request.overrideMimeType('text/html');
}
}
else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {
alert('could not load data');
}
}
}
if (!http_request) {
alert('Cannot create XMLHTTP instance');
return false;
}
if(onready == "updatemap") {
http_request.onreadystatechange = updatemap;
}
else {
http_request.onreadystatechange = updatesearchresults;
}
var geturl = url + '?' + parameters;
document.getElementById(idname + 'title').innerHTML = "loading new map
... "; //+ geturl;
http_request.open('GET', geturl, true);
http_request.async = false;
http_request.send(null);
}

// -------------- process XML ----------------------------
//process map data
function updatemap() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
//alert(http_request.responseText);
var xmlDoc = http_request.responseXML;
var titlearray = xmlDoc.getElementsByTagName('title');
var infoarray = xmlDoc.getElementsByTagName('info');
var zoomarray = xmlDoc.getElementsByTagName('zoom');
var longitudearray = xmlDoc.getElementsByTagName('longitude');
var lattitudearray = xmlDoc.getElementsByTagName('lattitude');
var info = serializeNode(infoarray[0]);
var a = lattitudearray[0].firstChild.nodeValue;
var o = longitudearray[0].firstChild.nodeValue;
var z = zoomarray[0].firstChild.nodeValue;
if(document.getElementById(idname + 'title')) {
document.getElementById(idname + 'title').innerHTML =
titlearray[0].firstChild.nodeValue;
}
if (document.getElementById(idname + 'info') && 1 == 2) {
document.getElementById(idname + 'info').innerHTML = info;
}
if(document.getElementById('outerinfo')) {
document.getElementById('outerinfo').innerHTML = '' + info + '';
}
GSrezoom(o,a,z);
}
else {
alert('There was a problem with the request.');
}
}
else {

}
}

//process search results
function updatesearchresults() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
var xmlDoc = http_request.responseXML;
var humansqlarray = xmlDoc.getElementsByTagName('humansql');
var humansql = serializeNode(humansqlarray[0]);
document.getElementById('humansql').innerHTML = humansql;
changemap();
}
else {
alert('There was a problem with the request.');
}
}
}

// -------------- XML details ----------------------------
//retrieve data from XML sheet
function serializeNode(node) {
if(node != undefined) {
var xml = "";
if(_browser.isSafari) {
xml = xmlText(node);
}
else if(_browser.isIE) {
xml = node.xml;
}
else {
var serializer = new XMLSerializer();
xml = serializer.serializeToString(node);
}
return xml;
}
else {
return undefined;
}
}

var DOM_ELEMENT_NODE = 1;
var DOM_TEXT_NODE = 3;
/**
* Returns the representation of a node as XML text.
*/
function xmlText(node) {
var ret = '';
if (node.nodeType == DOM_TEXT_NODE) {
ret += node.nodeValue;
}
else if (node.nodeType == DOM_ELEMENT_NODE) {
ret += '<' + node.nodeName;
for (var i = 0; i < node.attributes.length; ++i) {
var a = node.attributes[i];
if (a && a.nodeName && a.nodeValue) {
ret += ' ' + a.nodeName;
ret += '="' + a.nodeValue + '"';
}
}
if (node.childNodes.length == 0) {
ret += '/>';
}
else {
ret += '>';
for (var i = 0; i < node.childNodes.length; ++i) {
ret += arguments.callee(node.childNodes[i]);
}
ret += '</' + node.nodeName + '>';
}
}
return ret;
}

May I ask _why_ You don't have access to IE 6 anymore?

If it's because you have upgraded to IE7, please check out
http://labs.insert-title.com/labs/Mu...rticle795.aspx
which will guide you in installing multiple versions of IE on Windows
XP.

If it's because you are using Linux, you can install wine, and then
download ies4linux, found at
http://www.tatanka.com.br/ies4linux/page/Main_Page, which will give you
versions 5, 5.5 and 6 all running about as bug free as IE ever ran
before.

All the best.

Daz.

Dec 10 '06 #2

Daz wrote:
......
May I ask _why_ You don't have access to IE 6 anymore?
Installed 7, followed the link and found...

http://browsers.evolt.org/download.p...e6eolas_nt.zip

will install and work with that one.

Dec 10 '06 #3

windandwaves wrote:

I just found the problem... IE6 does not like the following line:

http_request.async = false;

So I took it out. The result, however, is that the script does not
seem to wait for one thing to finish before doing the next thing or
something like that. Well, it still works in FF, but not in IE6.
However, there are no errors in IE6.

Can someone tell me what
http_request.async = false;
means.... I think it means "do not process this out of sync with the
rest of the script"

and can someone tell me how to replace it with something more pallatble
for IE6?

Thank you

Nicolaas

Dec 11 '06 #4
Daz

windandwaves wrote:
windandwaves wrote:

I just found the problem... IE6 does not like the following line:

http_request.async = false;

So I took it out. The result, however, is that the script does not
seem to wait for one thing to finish before doing the next thing or
something like that. Well, it still works in FF, but not in IE6.
However, there are no errors in IE6.

Can someone tell me what
http_request.async = false;
means.... I think it means "do not process this out of sync with the
rest of the script"

and can someone tell me how to replace it with something more pallatble
for IE6?

Thank you

Nicolaas
Hi. Basically it tells the script to wait until it has received all of
the incoming data from the server, or in other words, to run
asynchronously with the server until the server stops sending data (or
in this case, tells the browser it's finished sending data). Otherwise
you are effectively processing data that might not be there, and in
fact, probably isn't.

I believe that for IE, you need to create a new ActiveXObject. As
Microsoft choose to be different, you will need to look into AJAX. This
article should get you on your way.
http://www.wwwcoder.com/main/parenti...8/default.aspx

Best of luck.

Daz.

Dec 11 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Dave | last post by:
After following Microsofts admonition to reformat my system before doing a final compilation of my app I got many warnings/errors upon compiling an rtf file created in word. I used the Help...
6
by: wukexin | last post by:
Help me, good men. I find mang books that introduce bit "mang header files",they talk too bit,in fact it is my too fool, I don't learn it, I have do a test program, but I have no correct doing...
3
by: Colin J. Williams | last post by:
Python advertises some basic service: C:\Python24>python Python 2.4.1 (#65, Mar 30 2005, 09:13:57) on win32 Type "help", "copyright", "credits" or "license" for more information. >>> With...
7
by: Corepaul | last post by:
Missing Help Files When I enter "recordset" as the keyword and search the Visual Basic Help index, I get many topics of interest in the resulting list. But there isn't any information available...
5
by: Steve | last post by:
I have written a help file (chm) for a DLL and referenced it using Help.ShowHelp My expectation is that a developer using my DLL would be able to access this help file during his development time...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.