• Welcome to Tux Reports: Where Penguins Fly. We hope you find the topics varied, interesting, and worthy of your time. Please become a member and join in the discussions.

IE 6 vs IE 8 Javascripting error

D

Doug65301

Flightless Bird
This code is working in IE 6 when we hit the same code with IE 8 i'm getting
a null or not an object error.

the error is occuring in the while loop when i'm hA1.innerText = vPro;
the while loop is actually executing for 2 occurences then failing on 3
(should do perform 8 times)

I have been able to debug it to the point that the error has something to do
with the OTR.className = "frmList". (The real kicker is if you run in debug
mode and step into the loop and execute this line everytime it works like a
charm).

I know its has something to do with new IE 8 standards but i am pulling my
hair out trying to figure out whats causing the issue. Any help would be most
appericated.


function fnLoadTable(workData)
{
// Parse the XML Data Island

var i, j, oTD, oTR;
var workData, workNodes;
i=0;
j=0;

// Test for a valid return code. On error, display error message.
msgCode = workData.getAttribute("ReturnCode");
msgText = workData.getAttribute("ReturnText");
msgData = workData.selectSingleNode("/PageRoot/BodyHead/Message").text;

if (msgCode != '0000')
{
msg = 'Error! [' + msgCode + '] ' + msgText + '\n\n' + msgData;
window.alert(msg);
window.status = msgText;
return false;
}

// Clear table before loading
fnClear();


// Place the contents of the XML Data Island into the table

workNodes = workData.selectNodes("/PageRoot/BodyMain");
TrlrScac.value =
workData.selectSingleNode("/PageRoot/BodyMain/KeyScac").text;
TrlrNbr.value =
workData.selectSingleNode("/PageRoot/BodyMain/KeyTrailer").text;
selType.value =
workData.selectSingleNode("/PageRoot/BodyMain/KeyType").text;
TransDate.value =
workData.selectSingleNode("/PageRoot/BodyMain/KeyTransDate").text;
TransTime.value =
workData.selectSingleNode("/PageRoot/BodyMain/KeyTransTime").text;

window.document.title = 'TEC223 - ' + vTrlrNbr;

i = 0;
workNodes = workData.selectNodes("/PageRoot/BodyMain/EqpRecord");
txtTotal.value = workNodes.selectSingleNode("Total").text;
txtWgt.value = workNodes.selectSingleNode("Wgt").text;
txtHU.value = workNodes.selectSingleNode("HU").text;
txtCap.value = workNodes.selectSingleNode("Cap").text;
txtCft.value = workNodes.selectSingleNode("Cft").text;

workNodes =
workData.selectNodes("/PageRoot/BodyMain/EqpRecord/WgpRecord");
j = workNodes.length;

// while (i != workNodes.length)
while ( i != j )

{

oTR = tblShpList.insertRow();
oTD = oTR.insertCell();
oTD.innerHTML = hidShpList.innerHTML;
oTR.className = "frmList";

// hA1.innerText = workNodes.selectSingleNode("WgpIdNbr").text;
var vPro = workNodes.selectSingleNode("WgpIdNbr").text;
hA1.innerText = vPro;
hA1.style.cursor = 'hand';
hA1.exWgpId = workNodes.selectSingleNode("WgpIdNbr").text;


hA2.innerText = workNodes.selectSingleNode("WgpOrig").text;
hA3.innerText = workNodes.selectSingleNode("WgpShpr").text;
hA4.innerText =
workNodes.selectSingleNode("WgpShprCity").text;
hA5.innerText = workNodes.selectSingleNode("WgpShprSt").text;
hA6.innerText = workNodes.selectSingleNode("WgpPcs").text;
hA7.innerText = workNodes.selectSingleNode("WgpHaz").text;
hA8.innerText = workNodes.selectSingleNode("WgpHL").text;
hA9.innerText = workNodes.selectSingleNode("WgpDueDate").text;
hA10.innerText = workNodes.selectSingleNode("WgpExcp").text;

hB2.innerText = workNodes.selectSingleNode("WgpDest").text;
hB3.innerText = workNodes.selectSingleNode("WgpCons").text;
hB4.innerText = workNodes.selectSingleNode("WgpConsCity").text;
hB5.innerText = workNodes.selectSingleNode("WgpConsSt").text;
hB6.innerText = workNodes.selectSingleNode("WgpWgt").text;
hB7.innerText = workNodes.selectSingleNode("WgpSrvc").text;
hB9.innerText = workNodes.selectSingleNode("WgpDelvDate").text;
hB10.innerText = workNodes.selectSingleNode("WgpDelvExcp").text;

i++;
}

// insert blank trailing row at end of table to insure table sizes correctly

oTR = tblShpList.insertRow();
oTR.style.display = 'none';
oTR.height = '100%';
oTD = oTR.insertCell();
// Reset the cursor

idPageBody.style.cursor = 'auto';

return;

}
 
P

PA Bear [MS MVP]

Flightless Bird
Developer-specific resources include:

MSDN IE Development Forum (post such questions here instead)
http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/threads

Tip: When posting in Developer forums, always include a link to your web
site or test pages in your first post.

IE Developer Center
http://msdn.microsoft.com/en-us/ie/default.aspx

Learn IE8
http://msdn.microsoft.com/en-us/ie/aa740473.aspx

HTML and DHTML Overviews and Tutorials
http://msdn.microsoft.com/en-us/library/ms537623.aspx and

Cascading Style Sheets (CSS)
http://msdn2.microsoft.com/en-us/ie/aa740476.aspx

Expression Web SuperPreview for Internet Explorer (free, stand-alone visual
debugging tool for IE6, IE7, and IE8)
http://www.microsoft.com/downloads/...FamilyID=8e6ac106-525d-45d0-84db-dccff3fae677

Expression Web SuperPreview Release Notes
http://www.microsoft.com/expression/products/Web_SuperPreviewReleaseNotes.aspx

Validators:
http://validator.w3.org/
http://jigsaw.w3.org/css-validator/


Doug65301 wrote:
> This code is working in IE 6 when we hit the same code with IE 8 i'm
> getting
> a null or not an object error.
>
> the error is occuring in the while loop when i'm hA1.innerText = vPro;
> the while loop is actually executing for 2 occurences then failing on 3
> (should do perform 8 times)
>
> I have been able to debug it to the point that the error has something to
> do
> with the OTR.className = "frmList". (The real kicker is if you run in
> debug
> mode and step into the loop and execute this line everytime it works like
> a
> charm).
>
> I know its has something to do with new IE 8 standards but i am pulling my
> hair out trying to figure out whats causing the issue. Any help would be
> most appericated.
>
>
> function fnLoadTable(workData)
> {
> // Parse the XML Data Island
>
> var i, j, oTD, oTR;
> var workData, workNodes;
> i=0;
> j=0;
>
> // Test for a valid return code. On error, display error message.
> msgCode = workData.getAttribute("ReturnCode");
> msgText = workData.getAttribute("ReturnText");
> msgData = workData.selectSingleNode("/PageRoot/BodyHead/Message").text;
>
> if (msgCode != '0000')
> {
> msg = 'Error! [' + msgCode + '] ' + msgText + '\n\n' + msgData;
> window.alert(msg);
> window.status = msgText;
> return false;
> }
>
> // Clear table before loading
> fnClear();
>
>
> // Place the contents of the XML Data Island into the table
>
> workNodes = workData.selectNodes("/PageRoot/BodyMain");
> TrlrScac.value =
> workData.selectSingleNode("/PageRoot/BodyMain/KeyScac").text;
> TrlrNbr.value =
> workData.selectSingleNode("/PageRoot/BodyMain/KeyTrailer").text;
> selType.value =
> workData.selectSingleNode("/PageRoot/BodyMain/KeyType").text;
> TransDate.value =
> workData.selectSingleNode("/PageRoot/BodyMain/KeyTransDate").text;
> TransTime.value =
> workData.selectSingleNode("/PageRoot/BodyMain/KeyTransTime").text;
>
> window.document.title = 'TEC223 - ' + vTrlrNbr;
>
> i = 0;
> workNodes = workData.selectNodes("/PageRoot/BodyMain/EqpRecord");
> txtTotal.value = workNodes.selectSingleNode("Total").text;
> txtWgt.value = workNodes.selectSingleNode("Wgt").text;
> txtHU.value = workNodes.selectSingleNode("HU").text;
> txtCap.value = workNodes.selectSingleNode("Cap").text;
> txtCft.value = workNodes.selectSingleNode("Cft").text;
>
> workNodes =
> workData.selectNodes("/PageRoot/BodyMain/EqpRecord/WgpRecord");
> j = workNodes.length;
>
> // while (i != workNodes.length)
> while ( i != j )
>
> {
>
> oTR = tblShpList.insertRow();
> oTD = oTR.insertCell();
> oTD.innerHTML = hidShpList.innerHTML;
> oTR.className = "frmList";
>
> // hA1.innerText =
> workNodes.selectSingleNode("WgpIdNbr").text; var vPro =
> workNodes.selectSingleNode("WgpIdNbr").text;
> hA1.innerText
> = vPro; hA1.style.cursor = 'hand';
> hA1.exWgpId =
> workNodes.selectSingleNode("WgpIdNbr").text;
>
>
> hA2.innerText = workNodes.selectSingleNode("WgpOrig").text;
> hA3.innerText = workNodes.selectSingleNode("WgpShpr").text;
> hA4.innerText =
> workNodes.selectSingleNode("WgpShprCity").text;
> hA5.innerText =
> workNodes.selectSingleNode("WgpShprSt").text;
> hA6.innerText = workNodes.selectSingleNode("WgpPcs").text;
> hA7.innerText = workNodes.selectSingleNode("WgpHaz").text;
> hA8.innerText = workNodes.selectSingleNode("WgpHL").text;
> hA9.innerText =
> workNodes.selectSingleNode("WgpDueDate").text;
> hA10.innerText
> = workNodes.selectSingleNode("WgpExcp").text;
>
> hB2.innerText = workNodes.selectSingleNode("WgpDest").text;
> hB3.innerText = workNodes.selectSingleNode("WgpCons").text;
> hB4.innerText =
> workNodes.selectSingleNode("WgpConsCity").text; hB5.innerText
> = workNodes.selectSingleNode("WgpConsSt").text;
> hB6.innerText
> = workNodes.selectSingleNode("WgpWgt").text; hB7.innerText =
> workNodes.selectSingleNode("WgpSrvc").text; hB9.innerText =
> workNodes.selectSingleNode("WgpDelvDate").text; hB10.innerText
> = workNodes.selectSingleNode("WgpDelvExcp").text;
>
> i++;
> }
>
> // insert blank trailing row at end of table to insure table sizes
> correctly
>
> oTR = tblShpList.insertRow();
> oTR.style.display = 'none';
> oTR.height = '100%';
> oTD = oTR.insertCell();
> // Reset the cursor
>
> idPageBody.style.cursor = 'auto';
>
> return;
>
> }
 
R

rob^_^

Flightless Bird
When testing, uncheck "Recover from rendering errors with Compatibility
View" on the Advanced tab of Internet Options.

You are injecting crap that trips the error handling, but this is not
invoked when you step through the debug stack as it is detached from the
current user account.

Regards.

"Doug65301" <Doug65301@discussions.microsoft.com> wrote in message
news:B3636A4A-00C1-4FBC-B598-651609F42A47@microsoft.com...
> This code is working in IE 6 when we hit the same code with IE 8 i'm
> getting
> a null or not an object error.
>
> the error is occuring in the while loop when i'm hA1.innerText = vPro;
> the while loop is actually executing for 2 occurences then failing on 3
> (should do perform 8 times)
>
> I have been able to debug it to the point that the error has something to
> do
> with the OTR.className = "frmList". (The real kicker is if you run in
> debug
> mode and step into the loop and execute this line everytime it works like
> a
> charm).
>
> I know its has something to do with new IE 8 standards but i am pulling my
> hair out trying to figure out whats causing the issue. Any help would be
> most
> appericated.
>
>
> function fnLoadTable(workData)
> {
> // Parse the XML Data Island
>
> var i, j, oTD, oTR;
> var workData, workNodes;
> i=0;
> j=0;
>
> // Test for a valid return code. On error, display error message.
> msgCode = workData.getAttribute("ReturnCode");
> msgText = workData.getAttribute("ReturnText");
> msgData = workData.selectSingleNode("/PageRoot/BodyHead/Message").text;
>
> if (msgCode != '0000')
> {
> msg = 'Error! [' + msgCode + '] ' + msgText + '\n\n' + msgData;
> window.alert(msg);
> window.status = msgText;
> return false;
> }
>
> // Clear table before loading
> fnClear();
>
>
> // Place the contents of the XML Data Island into the table
>
> workNodes = workData.selectNodes("/PageRoot/BodyMain");
> TrlrScac.value =
> workData.selectSingleNode("/PageRoot/BodyMain/KeyScac").text;
> TrlrNbr.value =
> workData.selectSingleNode("/PageRoot/BodyMain/KeyTrailer").text;
> selType.value =
> workData.selectSingleNode("/PageRoot/BodyMain/KeyType").text;
> TransDate.value =
> workData.selectSingleNode("/PageRoot/BodyMain/KeyTransDate").text;
> TransTime.value =
> workData.selectSingleNode("/PageRoot/BodyMain/KeyTransTime").text;
>
> window.document.title = 'TEC223 - ' + vTrlrNbr;
>
> i = 0;
> workNodes = workData.selectNodes("/PageRoot/BodyMain/EqpRecord");
> txtTotal.value = workNodes.selectSingleNode("Total").text;
> txtWgt.value = workNodes.selectSingleNode("Wgt").text;
> txtHU.value = workNodes.selectSingleNode("HU").text;
> txtCap.value = workNodes.selectSingleNode("Cap").text;
> txtCft.value = workNodes.selectSingleNode("Cft").text;
>
> workNodes =
> workData.selectNodes("/PageRoot/BodyMain/EqpRecord/WgpRecord");
> j = workNodes.length;
>
> // while (i != workNodes.length)
> while ( i != j )
>
> {
>
> oTR = tblShpList.insertRow();
> oTD = oTR.insertCell();
> oTD.innerHTML = hidShpList.innerHTML;
> oTR.className = "frmList";
>
> // hA1.innerText =
> workNodes.selectSingleNode("WgpIdNbr").text;
> var vPro = workNodes.selectSingleNode("WgpIdNbr").text;
> hA1.innerText = vPro;
> hA1.style.cursor = 'hand';
> hA1.exWgpId =
> workNodes.selectSingleNode("WgpIdNbr").text;
>
>
> hA2.innerText = workNodes.selectSingleNode("WgpOrig").text;
> hA3.innerText = workNodes.selectSingleNode("WgpShpr").text;
> hA4.innerText =
> workNodes.selectSingleNode("WgpShprCity").text;
> hA5.innerText =
> workNodes.selectSingleNode("WgpShprSt").text;
> hA6.innerText = workNodes.selectSingleNode("WgpPcs").text;
> hA7.innerText = workNodes.selectSingleNode("WgpHaz").text;
> hA8.innerText = workNodes.selectSingleNode("WgpHL").text;
> hA9.innerText =
> workNodes.selectSingleNode("WgpDueDate").text;
> hA10.innerText = workNodes.selectSingleNode("WgpExcp").text;
>
> hB2.innerText = workNodes.selectSingleNode("WgpDest").text;
> hB3.innerText = workNodes.selectSingleNode("WgpCons").text;
> hB4.innerText =
> workNodes.selectSingleNode("WgpConsCity").text;
> hB5.innerText =
> workNodes.selectSingleNode("WgpConsSt").text;
> hB6.innerText = workNodes.selectSingleNode("WgpWgt").text;
> hB7.innerText = workNodes.selectSingleNode("WgpSrvc").text;
> hB9.innerText =
> workNodes.selectSingleNode("WgpDelvDate").text;
> hB10.innerText =
> workNodes.selectSingleNode("WgpDelvExcp").text;
>
> i++;
> }
>
> // insert blank trailing row at end of table to insure table sizes
> correctly
>
> oTR = tblShpList.insertRow();
> oTR.style.display = 'none';
> oTR.height = '100%';
> oTD = oTR.insertCell();
> // Reset the cursor
>
> idPageBody.style.cursor = 'auto';
>
> return;
>
> }
>
>
 
Top