ampron
08-22-2007, 04:49 PM
Hi everybody,
So I've been learning javascript and I'm using it to write a site. What I needed to do was to have some javascript code pull information from an XML file, add markers with bubbles to a google map on the page, add some tables to my page, and then put the information in the table cells appropriately to make a reference list corresponding to the markers.
I programed the google map part successfully so that it made a map and pulled the XML data to make the markers with bubbles. This much code works on ie6, ie7, firefox, and safari3 beta for mac. This is where i ran into the problem; I added the following function to make the tables and insert the data. This function is run inside my for loop that makes the markers so when a marker is made the entry on the list is also made. The code with this function works beautifully on firefox and safari3 beta (mac), but when I open the page in ie6 or ie7 the table/list is no where to be seen. I'm assuming that this is because I'm using some javascript code in the function that is not supported by Microsoft browsers?
Any help on why I'm having cross-broswer issues would be greatly appreciated.
// function for Writing the refrence table
function writeEntry (barname, linkname, typeofbar, area, address1, address2, phonenum, letter, firstHit) {
if (firstHit == 1 ) {}
else {
var dividerow = document.createElement('tr');
document.getElementById('tablewrite').appendChild(dividerow);
var dividecell=dividerow.insertCell(0);
dividecell.setAttribute('width',559);
dividecell.setAttribute('height',6);
dividecell.setAttribute('class','barnamecell');
var divideline = document.createElement('img');
dividecell.appendChild(divideline);
divideline.src = "dividerLineFadding.jpg";
divideline.setAttribute('width',461);
divideline.setAttribute('height',6);
}
var boxrow = document.createElement('tr');
document.getElementById('tablewrite').appendChild(boxrow);
var boxcell=boxrow.insertCell(0);
boxcell.setAttribute('width',559);
boxcell.setAttribute('height',138);
boxcell.setAttribute('class','ridebox');
var boxtable = document.createElement('TABLE');
boxcell.appendChild(boxtable);
var boxtableRow = boxtable.insertRow(0);
var iconcell = boxtableRow.insertCell(0);
iconcell.setAttribute('height',137);
iconcell.setAttribute('style','text-align:center;vertical-align:middle');
var icon = document.createElement('img');
iconcell.appendChild(icon);
icon.src = "googlemarkers/marker" + letter + ".png";
icon.setAttribute('width',20);
icon.setAttribute('height',34);
icon.setAttribute('style','margin-left:5px');
var textcell = boxtableRow.insertCell(1);
textcell.setAttribute('height',137);
var p1 = document.createElement('p');
textcell.appendChild(p1);
p1.setAttribute('class','eventpostingsubject');
var barnamelink = document.createElement('a');
p1.appendChild(barnamelink);
barnamelink.setAttribute('href','http://www.raleighbarhopper.com/' + linkname + '.html');
var p1text = document.createTextNode(barname);
barnamelink.appendChild(p1text);
var p2 = document.createElement('p');
textcell.appendChild(p2);
p2.setAttribute('class','eventpostingdate');
var fonttag2 = document.createElement('font');
p2.appendChild(fonttag2);
fonttag2.setAttribute('style','font-style:normal');
var p2text1 = document.createTextNode('Type of Bar: ');
fonttag2.appendChild(p2text1);
var p2text2 = document.createTextNode(typeofbar);
p2.appendChild(p2text2);
var p3 = document.createElement('p');
textcell.appendChild(p3);
p3.setAttribute('class','eventpostingdate');
var fonttag3 = document.createElement('font');
p3.appendChild(fonttag3);
fonttag3.setAttribute('style','font-style:normal');
var p3text1 = document.createTextNode('Area: ');
fonttag3.appendChild(p3text1);
var p3text2 = document.createTextNode(area);
p3.appendChild(p3text2);
var p4 = document.createElement('p');
textcell.appendChild(p4);
p4.setAttribute('class','eventpostingdate');
var fonttag4 = document.createElement('font');
p4.appendChild(fonttag4);
fonttag4.setAttribute('style','font-style:normal');
var p4text1 = document.createTextNode('Address: ');
fonttag4.appendChild(p4text1);
var p4text2 = document.createTextNode(address1);
p4.appendChild(p4text2);
var p5 = document.createElement('p');
textcell.appendChild(p5);
p5.setAttribute('class','eventpostingdate');
p5.setAttribute('style','margin-left:73px');
var p5text = document.createTextNode(address2);
p5.appendChild(p5text);
var p6 = document.createElement('p');
textcell.appendChild(p6);
p6.setAttribute('class','eventpostingdate');
var fonttag6 = document.createElement('font');
p6.appendChild(fonttag6);
fonttag6.setAttribute('style','font-style:normal');
var p6text1 = document.createTextNode('Phone Number: ');
fonttag6.appendChild(p6text1);
var p6text2 = document.createTextNode(phonenum);
p6.appendChild(p6text2);
}
I am a fairly new javascript user and so if anyone thinks that the problem is in some other part of the page let me know and I will make that available for review.
So I've been learning javascript and I'm using it to write a site. What I needed to do was to have some javascript code pull information from an XML file, add markers with bubbles to a google map on the page, add some tables to my page, and then put the information in the table cells appropriately to make a reference list corresponding to the markers.
I programed the google map part successfully so that it made a map and pulled the XML data to make the markers with bubbles. This much code works on ie6, ie7, firefox, and safari3 beta for mac. This is where i ran into the problem; I added the following function to make the tables and insert the data. This function is run inside my for loop that makes the markers so when a marker is made the entry on the list is also made. The code with this function works beautifully on firefox and safari3 beta (mac), but when I open the page in ie6 or ie7 the table/list is no where to be seen. I'm assuming that this is because I'm using some javascript code in the function that is not supported by Microsoft browsers?
Any help on why I'm having cross-broswer issues would be greatly appreciated.
// function for Writing the refrence table
function writeEntry (barname, linkname, typeofbar, area, address1, address2, phonenum, letter, firstHit) {
if (firstHit == 1 ) {}
else {
var dividerow = document.createElement('tr');
document.getElementById('tablewrite').appendChild(dividerow);
var dividecell=dividerow.insertCell(0);
dividecell.setAttribute('width',559);
dividecell.setAttribute('height',6);
dividecell.setAttribute('class','barnamecell');
var divideline = document.createElement('img');
dividecell.appendChild(divideline);
divideline.src = "dividerLineFadding.jpg";
divideline.setAttribute('width',461);
divideline.setAttribute('height',6);
}
var boxrow = document.createElement('tr');
document.getElementById('tablewrite').appendChild(boxrow);
var boxcell=boxrow.insertCell(0);
boxcell.setAttribute('width',559);
boxcell.setAttribute('height',138);
boxcell.setAttribute('class','ridebox');
var boxtable = document.createElement('TABLE');
boxcell.appendChild(boxtable);
var boxtableRow = boxtable.insertRow(0);
var iconcell = boxtableRow.insertCell(0);
iconcell.setAttribute('height',137);
iconcell.setAttribute('style','text-align:center;vertical-align:middle');
var icon = document.createElement('img');
iconcell.appendChild(icon);
icon.src = "googlemarkers/marker" + letter + ".png";
icon.setAttribute('width',20);
icon.setAttribute('height',34);
icon.setAttribute('style','margin-left:5px');
var textcell = boxtableRow.insertCell(1);
textcell.setAttribute('height',137);
var p1 = document.createElement('p');
textcell.appendChild(p1);
p1.setAttribute('class','eventpostingsubject');
var barnamelink = document.createElement('a');
p1.appendChild(barnamelink);
barnamelink.setAttribute('href','http://www.raleighbarhopper.com/' + linkname + '.html');
var p1text = document.createTextNode(barname);
barnamelink.appendChild(p1text);
var p2 = document.createElement('p');
textcell.appendChild(p2);
p2.setAttribute('class','eventpostingdate');
var fonttag2 = document.createElement('font');
p2.appendChild(fonttag2);
fonttag2.setAttribute('style','font-style:normal');
var p2text1 = document.createTextNode('Type of Bar: ');
fonttag2.appendChild(p2text1);
var p2text2 = document.createTextNode(typeofbar);
p2.appendChild(p2text2);
var p3 = document.createElement('p');
textcell.appendChild(p3);
p3.setAttribute('class','eventpostingdate');
var fonttag3 = document.createElement('font');
p3.appendChild(fonttag3);
fonttag3.setAttribute('style','font-style:normal');
var p3text1 = document.createTextNode('Area: ');
fonttag3.appendChild(p3text1);
var p3text2 = document.createTextNode(area);
p3.appendChild(p3text2);
var p4 = document.createElement('p');
textcell.appendChild(p4);
p4.setAttribute('class','eventpostingdate');
var fonttag4 = document.createElement('font');
p4.appendChild(fonttag4);
fonttag4.setAttribute('style','font-style:normal');
var p4text1 = document.createTextNode('Address: ');
fonttag4.appendChild(p4text1);
var p4text2 = document.createTextNode(address1);
p4.appendChild(p4text2);
var p5 = document.createElement('p');
textcell.appendChild(p5);
p5.setAttribute('class','eventpostingdate');
p5.setAttribute('style','margin-left:73px');
var p5text = document.createTextNode(address2);
p5.appendChild(p5text);
var p6 = document.createElement('p');
textcell.appendChild(p6);
p6.setAttribute('class','eventpostingdate');
var fonttag6 = document.createElement('font');
p6.appendChild(fonttag6);
fonttag6.setAttribute('style','font-style:normal');
var p6text1 = document.createTextNode('Phone Number: ');
fonttag6.appendChild(p6text1);
var p6text2 = document.createTextNode(phonenum);
p6.appendChild(p6text2);
}
I am a fairly new javascript user and so if anyone thinks that the problem is in some other part of the page let me know and I will make that available for review.