This code causes Netscape to Crash. Can someone s

Results 1 to 2 of 2

Thread: This code causes Netscape to Crash. Can someone s

  1. #1
    Join Date
    Dec 1969

    Default This code causes Netscape to Crash. Can someone s

    Hi all;<BR><BR>I have this Java Script that runs ok in IE but not in Netscape. Can anyone say why?<BR><BR>&#060;SCRIPT language="JAVASCRIPT"&#062;<BR>// intNumTabs : number of tabs in the control<BR>// intCurrentTab : currently selected tab<BR>var intNumTabs = 3, intCurrentTab = 0<BR><BR>function onClickTab()<BR>{<BR> // check if it&#039s the TD element event (the TR will buddble down to TD)<BR> if ("TD"==event.srcElement.tagName) <BR> {<BR> // check if it&#039s not the same tab that was already selected<BR> if (event.srcElement.cellIndex != intCurrentTab) <BR> {<BR> setTab(event.srcElement.cellIndex)<BR> }<BR> }<BR>}<BR><BR>function setTab(newTab)<BR>{<BR>// call the onLeave event of the currently selected tab<BR>switch (intCurrentTab) <BR> { <BR> case (0):<BR> onLeaveOwner();<BR> break; <BR> case (1):<BR> onLeaveProperty();<BR> break;<BR> case (2):<BR> onLeaveLegal();<BR> break; <BR> }<BR><BR> var tblTabControl = document.all.tblTabControl<BR><BR> // assign the new tab to the current tab variable<BR> intCurrentTab = newTab;<BR><BR> // Loop through each tab to change the appearance (class)<BR> for (var i = 0; i &#060;= intNumTabs; i++)<BR> {<BR> switch (i)<BR> {<BR> // tab to the left<BR> case (newTab - 1):<BR> tblTabControl.rows(0).cells(i).className = "clsTabSelLeft"<BR> tblTabControl.rows(1).cells(i).className = "clsTabContent"<BR> break;<BR><BR> // tab to the right<BR> case (newTab + 1):<BR> if (i != intNumTabs)<BR> {<BR> tblTabControl.rows(0).cells(i).className = "clsTabSelRight";<BR> tblTabControl.rows(1).cells(i).className = "clsTabContent"<BR> }<BR> break;<BR><BR> // tab itself<BR> case (newTab):<BR> tblTabControl.rows(0).cells(i).className = "clsTabSel";<BR> tblTabControl.rows(1).cells(i).className = "clsTabContentSel";<BR> break;<BR><BR> // all other tabs<BR> default:<BR> if (i != intNumTabs)<BR> {<BR> tblTabControl.rows(0).cells(i).className = "clsTab";<BR> tblTabControl.rows(1).cells(i).className = "clsTabContent";<BR> }<BR> break;<BR> }<BR> }<BR><BR>// call the onEnter of the newly selected tab<BR>switch (newTab) <BR> { <BR> case (0):<BR> onEnterOwner();<BR> break; <BR> case (1):<BR> onEnterProperty();<BR> break;<BR> case (2):<BR> onEnterLegal();<BR> break; <BR> }<BR>}<BR><BR><BR>function onEnterOwner()<BR>{<BR> = "visible"<BR>}<BR> <BR>function onEnterProperty()<BR>{<BR> = "visible"<BR>}<BR> <BR>function onEnterLegal()<BR>{<BR> = "visible"<BR>}<BR> <BR>function onLeaveOwner()<BR>{<BR> = "hidden"<BR>}<BR><BR>function onLeaveProperty()<BR>{<BR> = "hidden"<BR>}<BR><BR>function onLeaveLegal()<BR>{<BR> = "hidden"<BR>}<BR> <BR>function CheckInput()<BR>{<BR> if(document.QuickPayment.BillNumber.value=="")<BR> {<BR> alert(&#039You must enter a Bill Number before taking a payment.&#039); return(false);<BR> }<BR> else<BR> {<BR> return(true);<BR> }<BR>}<BR>&#060;/SCRIPT&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: This code causes Netscape to Crash. Can someo

    netscape doesn&#039t understand document.all, it uses document.layers to acheive a similar effect, just to be awkward.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts