Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: IE and Netscape


Message #1 by "Antonello Corbo" <antonello65@l...> on Tue, 31 Jul 2001 15:27:16 -0700
Thanks for your advice

-----Original Message-----
From: Johnson, Israel [mailto:IJohnson@R...]
Sent: Tuesday, July 31, 2001 15:40
To: javascript
Subject: [javascript] RE: IE and Netscape


document.all is not recognized in Netscape's BOM.  Try and reference
elements by their name or id.

-----Original Message-----
From: Antonello Corbo [mailto:antonello65@l...]
Sent: Tuesday, July 31, 2001 6:27 PM
To: javascript
Subject: [javascript] IE and Netscape


Hello,
i converted all my vbscript code into javascript for browser compatibility,
but after the conversion in IE all works but not in Netscape.
im a newsbie and pheraphs i have wronged something.

Can someone help me?
Here is the code.


<html>



<head>
<style type='text/css'>A:link{color: #DC1D07; TEXT-DECORATION: none}
A:visited {COLOR: #DC1D07; TEXT-DECORATION: none}
A:active {COLOR: #DC1D07; TEXT-DECORATION: none}
<!--
  A:Hover {color:"#DC1D07"; TEXT-DECORATION: none}
  -->
{
  font-family:Verdana;
  font-size:10pt;
  color="#2887E0";
}
</style>
<SCRIPT LANGUAGE=javascript>
<!--
function fncmsg(id){
file://alert (id)
file://alert (document.all.tblLotto.rows(1).cells(1).innerText)
file://alert (document.all.tblLotto.cells.item(id).bgColor)
window.event.returnValue = false
var a;
var b=new String(id+1)
file://alert (b)
if ((b.length)==1)
  b= "0" + b
file://alert (b.length)
if (document.all.tblLotto.cells.item(id).bgColor == "#1133f3")
   file://alert ("ok")
   {
   document.all.tblLotto.cells.item(id).bgColor = "#ffffff"
   document.frmlotto.txtChoice.value =""
   var count=0;
   for (i=0; i < document.all.tblLotto.rows.length; i++) {
        for (j=0; j < document.all.tblLotto.rows(i).cells.length; j++) {
            if (document.all.tblLotto.rows(i).cells(j).bgColor == "#1133f3")
            {
              document.frmlotto.txtChoice.value 
document.frmlotto.txtChoice.value + "-"
              var c=new String(i)
              file://alert (c)
              var d=new String (j+1)
              file://alert (d)
              var e=(c+d)
              file://alert (e)
              document.frmlotto.txtChoice.value 
document.frmlotto.txtChoice.value + e
            }
            count++;
        }
    }
   }
else

  a=document.frmlotto.txtChoice.value
  if (a.length >=18)
     alert("Sono consentite fino ad un massimo di 6 selezioni");
  else


  document.all.tblLotto.cells.item(id).bgColor = "#1133f3"
  document.frmlotto.txtChoice.value = document.frmlotto.txtChoice.value +
"-"
  document.frmlotto.txtChoice.value = document.frmlotto.txtChoice.value +
(b)
    }
 }
 }
function fncCancel() {
    var count=0;
    for (i=0; i < document.all.tblLotto.rows.length; i++) {
        for (j=0; j < document.all.tblLotto.rows(i).cells.length; j++) {
            document.all.tblLotto.rows(i).cells(j).bgColor = "#ffffff";
            count++;
        }
document.frmlotto.txtChoice.value = ""
    }
}
file://-->
</SCRIPT>
</head>
<body>
<form name="frmlotto">
<div align="center">
<center>
  <table border="1" cellpadding="2" cellspacing="0" id="tblLotto">
    <tr>
<td onclick=fncmsg(0) id=0><a href="#">1</a></td>
<td onclick=fncmsg(1) id=1><a href="#">2</a></td>
<td onclick=fncmsg(2) id=2><a href="#">3</a></td>
<td onclick=fncmsg(3) id=3><a href="#">4</a></td>
<td onclick=fncmsg(4) id=4><a href="#">5</a></td>
<td onclick=fncmsg(5) id=5><a href="#">6</a></td>
<td onclick=fncmsg(6) id=6><a href="#">7</a></td>
<td onclick=fncmsg(7) id=7><a href="#">8</a></td>
<td onclick=fncmsg(8) id=8><a href="#">9</a></td>
<td onclick=fncmsg(9) id=9><a href="#">10</a></td>
    </tr>
    <tr>
<td onclick=fncmsg(10) id=10><a href="#">11</a></td>
<td onclick=fncmsg(11) id=11><a href="#">12</a></td>
<td onclick=fncmsg(12) id=12><a href="#">13</a></td>
<td onclick=fncmsg(13) id=13><a href="#">14</a></td>
<td onclick=fncmsg(14) id=14><a href="#">15</a></td>
<td onclick=fncmsg(15) id=15><a href="#">16</a></td>
<td onclick=fncmsg(16) id=16><a href="#">17</a></td>
<td onclick=fncmsg(17) id=17><a href="#">18</a></td>
<td onclick=fncmsg(18) id=18><a href="#">19</a></td>
<td onclick=fncmsg(19) id=19><a href="#">20</a></td>
    </tr>
    <tr>
<td onclick=fncmsg(20) id=20><a href="#">21</a></td>
<td onclick=fncmsg(21) id=21><a href="#">22</a></td>
<td onclick=fncmsg(22) id=22><a href="#">23</a></td>
<td onclick=fncmsg(23) id=23><a href="#">24</a></td>
<td onclick=fncmsg(24) id=24><a href="#">25</a></td>
<td onclick=fncmsg(25) id=25><a href="#">26</a></td>
<td onclick=fncmsg(26) id=26><a href="#">27</a></td>
<td onclick=fncmsg(27) id=27><a href="#">28</a></td>
<td onclick=fncmsg(28) id=28><a href="#">29</a></td>
<td onclick=fncmsg(29) id=29><a href="#">30</a></td>
    </tr>
    <tr>
<td onclick=fncmsg(30) id=30><a href="#">31</a></td>
<td onclick=fncmsg(31) id=31><a href="#">32</a></td>
<td onclick=fncmsg(32) id=32><a href="#">33</a></td>
<td onclick=fncmsg(33) id=33><a href="#">34</a></td>
<td onclick=fncmsg(34) id=34><a href="#">35</a></td>
<td onclick=fncmsg(35) id=35><a href="#">36</a></td>
<td onclick=fncmsg(36) id=36><a href="#">37</a></td>
<td onclick=fncmsg(37) id=37><a href="#">38</a></td>
<td onclick=fncmsg(38) id=38><a href="#">39</a></td>
<td onclick=fncmsg(39) id=39><a href="#">40</a></td>
    </tr>
    <tr>
<td onclick=fncmsg(40) id=40><a href="#">41</a></td>
<td onclick=fncmsg(41) id=41><a href="#">42</a></td>
<td onclick=fncmsg(42) id=42><a href="#">43</a></td>
<td onclick=fncmsg(43) id=43><a href="#">44</a></td>
<td onclick=fncmsg(44) id=44><a href="#">45</a></td>
<td onclick=fncmsg(45) id=45><a href="#">46</a></td>
<td onclick=fncmsg(46) id=46><a href="#">47</a></td>
<td onclick=fncmsg(47) id=47><a href="#">48</a></td>
<td onclick=fncmsg(48) id=48><a href="#">49</a></td>
<td onclick=fncmsg(49) id=49><a href="#">50</a></td>
    </tr>
    <tr>
<td onclick=fncmsg(50) id=50><a href="#">51</a></td>
<td onclick=fncmsg(51) id=51><a href="#">52</a></td>
<td onclick=fncmsg(52) id=52><a href="#">53</a></td>
<td onclick=fncmsg(53) id=53><a href="#">54</a></td>
<td onclick=fncmsg(54) id=54><a href="#">55</a></td>
<td onclick=fncmsg(55) id=55><a href="#">56</a></td>
<td onclick=fncmsg(56) id=56><a href="#">57</a></td>
<td onclick=fncmsg(57) id=57><a href="#">58</a></td>
<td onclick=fncmsg(58) id=58><a href="#">59</a></td>
<td onclick=fncmsg(59) id=59><a href="#">60</a></td>
    </tr>
    <tr>
<td onclick=fncmsg(60) id=60><a href="#">61</a></td>
<td onclick=fncmsg(61) id=61><a href="#">62</a></td>
<td onclick=fncmsg(62) id=62><a href="#">63</a></td>
<td onclick=fncmsg(63) id=63><a href="#">64</a></td>
<td onclick=fncmsg(64) id=64><a href="#">65</a></td>
<td onclick=fncmsg(65) id=65><a href="#">66</a></td>
<td onclick=fncmsg(66) id=66><a href="#">67</a></td>
<td onclick=fncmsg(67) id=67><a href="#">68</a></td>
<td onclick=fncmsg(68) id=68><a href="#">69</a></td>
<td onclick=fncmsg(69) id=69><a href="#">70</a></td>
    </tr>
    <tr>
<td onclick=fncmsg(70) id=70><a href="#">71</a></td>
<td onclick=fncmsg(71) id=71><a href="#">72</a></td>
<td onclick=fncmsg(72) id=72><a href="#">73</a></td>
<td onclick=fncmsg(73) id=73><a href="#">74</a></td>
<td onclick=fncmsg(74) id=74><a href="#">75</a></td>
<td onclick=fncmsg(75) id=75><a href="#">76</a></td>
<td onclick=fncmsg(76) id=76><a href="#">77</a></td>
<td onclick=fncmsg(77) id=77><a href="#">78</a></td>
<td onclick=fncmsg(78) id=78><a href="#">79</a></td>
<td onclick=fncmsg(79) id=79><a href="#">80</a></td>
    </tr>
    <tr>
<td onclick=fncmsg(80) id=80><a href="#">81</a></td>
<td onclick=fncmsg(81) id=81><a href="#">82</a></td>
<td onclick=fncmsg(82) id=82><a href="#">83</a></td>
<td onclick=fncmsg(83) id=83><a href="#">84</a></td>
<td onclick=fncmsg(84) id=84><a href="#">85</a></td>
<td onclick=fncmsg(85) id=85><a href="#">86</a></td>
<td onclick=fncmsg(86) id=86><a href="#">87</a></td>
<td onclick=fncmsg(87) id=87><a href="#">88</a></td>
<td onclick=fncmsg(88) id=88><a href="#">89</a></td>
<td onclick=fncmsg(89) id=89><a href="#">90</a></td>
    </tr>
  </table>
  </center>
</div>
<div align="center">
  <center>
  <table border="0" cellpadding="0" cellspacing="0">
  <tr>
  <td><input type="button" value="Cancella" onclick=fncCancel()></td>
  </tr>
  </table>
  </center>
</div>
<input type="text" name="txtChoice" value="">
</form>
</body>


</html>



  Return to Index