I have the following script that is giving me fits.
Works just how I want in FF2, but goes bananas in MSIE
No error messages with either browser.
Below is the part that I believe is giving me problems.
I can provide more, but below is the only part that doesn’t seem to work.
[code=php]
function ShowDB() {
var obj = document.getElementById(‘LDBase’);
if (obj.value == ”) { alert(‘Load Entries first’); return; }
SplitDB();
var tbl = ”;
tbl = ”; // ‘<div>’;
var str = ”;
var classchange = ”;
for (p=0; p<srec.length; p++) {
tmp = srec[p].split(‘|’);
i = Number(tmp[1]); // alert(srec[p]+’|’+i+’ : ‘+recs[i]);
rec = recs[i].split(‘|’);
if (OptionsToCheck(recs[i]) == true) {
str += ‘<div style=”background-color:yellow;height:10px;”><hr></div>’;
str += ‘<div class=”c0″>’;
str += ‘ <div class=”c1″><em>Opportunity:</em></div> <div class=”c2″>’+rec[1]+'</div><br class=”clear”>’;
str += ‘ <div class=”c1″><em>Activity:</em></div> <div class=”c2″>’+rec[2]+'</div><br class=”clear”>’;
str += ‘ <div class=”c1″><em>Area:</em></div> <div class=”c2″>’+rec[3]+'</div><br class=”clear”>’;
str += ‘ <div class=”c1″><em>City:</em></div> <div class=”c2″>’+rec[4]+'</div><br class=”clear”>’;
str += ‘ <div class=”c1″><em>Contact:</em></div> <div class=”c2″>’+rec[5]+'</div><br class=”clear”>’;
str += ‘ <div class=”c1″><em>E-mail</em></div> <div class=”c2″>’+rec[6]+'</div><br class=”clear”>’;
str += ‘ <div class=”c1″><em>Phone:</em></div> <div class=”c2″>’+rec[9]+'</div><br class=”clear”>’;
str += ‘ <div class=”c1″><em>Fax:</em></div> <div class=”c2″>’+rec[10]+'</div><br class=”clear”>’;
str += ‘ <div class=”c1″><em>Posted:</em></div> <div class=”c2″>’+rec[0]+'</div><br class=”clear”>’;
str += ‘</div>’;
str += ‘<div class=”c3″><em>Description:</em><br>’+rec[7]+'</div>’;
str += ‘<br class=”clear”>’;
// str += ‘</div>’;
}
}
if (str == ”) { str = ‘<h1>No records to display</h1>’; }
str = tbl+str; // +'</div>’;
obj = document.getElementById(‘SDBase’);
obj.innerHTML = str;
}
The ‘LDBase’ is a <textarea> that is loaded using ajax and contains the fields to display separated by the ‘|’ symbol and each records ends in ‘}’. I have verified that the data is available and can be parsed correctly.
‘SDBase’ is just another ‘<DIV>’ tag to hold the display of the record fields.
I changed the original design using <TABLE> elements because I had read that MSIE doesn’t work right when placed on the screen using ‘.innerHTML’.
In a table version, I also tried to add appropriate <TBODY> tags, but still nogo.
Instead I am using <DIV> tags with the CSS float attribute. Is there a limitation doing this as well?
Has anyone ever heard of a problem doing this.
Each record display starts with a <HR> followed by a left and right display. On the left are the fields of Opportunity, Activity, Area, … Posted and on the right is the description field of the record entry.
I included a check for when no matching records are found.
Even if you don’t know what the problem is causing the good display in FF and the non-display in MSIE, any hints on where to place any debugging code to determine what needs to be changed? I’m at a loss to know what to change next.
You can see the actual program in operation at: [url]http://www.nova.edu/optometry/placement/jobs.htm
Using FF, all displays fine. Jumpy screen and no display in MSIE.
Thanks for any thoughts on the matter.