TechTalkz.com Home

Go Back   Windows Help & Support > Internet Explorer
Home Register Forum Rules FAQ User Blogs Gallery

IE 6 vs IE 8 Javascripting error

Internet Explorer


Reply
 
LinkBack Thread Tools Display Modes
Old 05-12-2010, 10:30 PM   #1
Doug65301
Guest
 
Posts: n/a
Default IE 6 vs IE 8 Javascripting error

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[i].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[i].selectSingleNode("Total").text;
txtWgt.value = workNodes[i].selectSingleNode("Wgt").text;
txtHU.value = workNodes[i].selectSingleNode("HU").text;
txtCap.value = workNodes[i].selectSingleNode("Cap").text;
txtCft.value = workNodes[i].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[i].innerText = workNodes[i].selectSingleNode("WgpIdNbr").text;
var vPro = workNodes[i].selectSingleNode("WgpIdNbr").text;
hA1[i].innerText = vPro;
hA1[i].style.cursor = 'hand';
hA1[i].exWgpId = workNodes[i].selectSingleNode("WgpIdNbr").text;


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

hB2[i].innerText = workNodes[i].selectSingleNode("WgpDest").text;
hB3[i].innerText = workNodes[i].selectSingleNode("WgpCons").text;
hB4[i].innerText = workNodes[i].selectSingleNode("WgpConsCity").text;
hB5[i].innerText = workNodes[i].selectSingleNode("WgpConsSt").text;
hB6[i].innerText = workNodes[i].selectSingleNode("WgpWgt").text;
hB7[i].innerText = workNodes[i].selectSingleNode("WgpSrvc").text;
hB9[i].innerText = workNodes[i].selectSingleNode("WgpDelvDate").text;
hB10[i].innerText = workNodes[i].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;

}


Advertisement

  Reply With Quote
Old 05-12-2010, 10:30 PM   #2
PA Bear [MS MVP]
Guest
 
Posts: n/a
Default Re: IE 6 vs IE 8 Javascripting error

Developer-specific resources include:

MSDN IE Development Forum (post such questions here instead)
http://social.msdn.microsoft.com/For...opment/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/d...b-dccff3fae677

Expression Web SuperPreview Release Notes
http://www.microsoft.com/expression/...easeNotes.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[i].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[i].selectSingleNode("Total").text;
> txtWgt.value = workNodes[i].selectSingleNode("Wgt").text;
> txtHU.value = workNodes[i].selectSingleNode("HU").text;
> txtCap.value = workNodes[i].selectSingleNode("Cap").text;
> txtCft.value = workNodes[i].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[i].innerText =
> workNodes[i].selectSingleNode("WgpIdNbr").text; var vPro =
> workNodes[i].selectSingleNode("WgpIdNbr").text;
> hA1[i].innerText
> = vPro; hA1[i].style.cursor = 'hand';
> hA1[i].exWgpId =
> workNodes[i].selectSingleNode("WgpIdNbr").text;
>
>
> hA2[i].innerText = workNodes[i].selectSingleNode("WgpOrig").text;
> hA3[i].innerText = workNodes[i].selectSingleNode("WgpShpr").text;
> hA4[i].innerText =
> workNodes[i].selectSingleNode("WgpShprCity").text;
> hA5[i].innerText =
> workNodes[i].selectSingleNode("WgpShprSt").text;
> hA6[i].innerText = workNodes[i].selectSingleNode("WgpPcs").text;
> hA7[i].innerText = workNodes[i].selectSingleNode("WgpHaz").text;
> hA8[i].innerText = workNodes[i].selectSingleNode("WgpHL").text;
> hA9[i].innerText =
> workNodes[i].selectSingleNode("WgpDueDate").text;
> hA10[i].innerText
> = workNodes[i].selectSingleNode("WgpExcp").text;
>
> hB2[i].innerText = workNodes[i].selectSingleNode("WgpDest").text;
> hB3[i].innerText = workNodes[i].selectSingleNode("WgpCons").text;
> hB4[i].innerText =
> workNodes[i].selectSingleNode("WgpConsCity").text; hB5[i].innerText
> = workNodes[i].selectSingleNode("WgpConsSt").text;
> hB6[i].innerText
> = workNodes[i].selectSingleNode("WgpWgt").text; hB7[i].innerText =
> workNodes[i].selectSingleNode("WgpSrvc").text; hB9[i].innerText =
> workNodes[i].selectSingleNode("WgpDelvDate").text; hB10[i].innerText
> = workNodes[i].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;
>
> }


  Reply With Quote
Old 05-12-2010, 10:30 PM   #3
rob^_^
Guest
 
Posts: n/a
Default Re: IE 6 vs IE 8 Javascripting error

Advertisement
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[i].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[i].selectSingleNode("Total").text;
> txtWgt.value = workNodes[i].selectSingleNode("Wgt").text;
> txtHU.value = workNodes[i].selectSingleNode("HU").text;
> txtCap.value = workNodes[i].selectSingleNode("Cap").text;
> txtCft.value = workNodes[i].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[i].innerText =
> workNodes[i].selectSingleNode("WgpIdNbr").text;
> var vPro = workNodes[i].selectSingleNode("WgpIdNbr").text;
> hA1[i].innerText = vPro;
> hA1[i].style.cursor = 'hand';
> hA1[i].exWgpId =
> workNodes[i].selectSingleNode("WgpIdNbr").text;
>
>
> hA2[i].innerText = workNodes[i].selectSingleNode("WgpOrig").text;
> hA3[i].innerText = workNodes[i].selectSingleNode("WgpShpr").text;
> hA4[i].innerText =
> workNodes[i].selectSingleNode("WgpShprCity").text;
> hA5[i].innerText =
> workNodes[i].selectSingleNode("WgpShprSt").text;
> hA6[i].innerText = workNodes[i].selectSingleNode("WgpPcs").text;
> hA7[i].innerText = workNodes[i].selectSingleNode("WgpHaz").text;
> hA8[i].innerText = workNodes[i].selectSingleNode("WgpHL").text;
> hA9[i].innerText =
> workNodes[i].selectSingleNode("WgpDueDate").text;
> hA10[i].innerText = workNodes[i].selectSingleNode("WgpExcp").text;
>
> hB2[i].innerText = workNodes[i].selectSingleNode("WgpDest").text;
> hB3[i].innerText = workNodes[i].selectSingleNode("WgpCons").text;
> hB4[i].innerText =
> workNodes[i].selectSingleNode("WgpConsCity").text;
> hB5[i].innerText =
> workNodes[i].selectSingleNode("WgpConsSt").text;
> hB6[i].innerText = workNodes[i].selectSingleNode("WgpWgt").text;
> hB7[i].innerText = workNodes[i].selectSingleNode("WgpSrvc").text;
> hB9[i].innerText =
> workNodes[i].selectSingleNode("WgpDelvDate").text;
> hB10[i].innerText =
> workNodes[i].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;
>
> }
>
>


Advertisement

  Reply With Quote
Reply

Thread Tools
Display Modes



< Windows Help - MS Office Help >


New To Site? Need Help?

All times are GMT. The time now is 08:28 AM.


vBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright © 2005-2008, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional