Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Mar 2004
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    innerhtml problem with NS

    I have the following DIV in my html code:

    <div id="testdiv">
    &nbsp;
    </div>

    When I do
    displayzone.innerHTML="<table><tr><td>test</td></tr></table>";
    it works with iexplorer, opera, firefox but not with netscape.

    Anyone knows a way to do this?

    Thanks

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    verison of netscape? If you say 4, it is a bunch of work to do it in an outdated browser.

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    New Coder
    Join Date
    Mar 2004
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Ns6

    Thanks

  • #4
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    How is displayzone defined? Showing more code will help.

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #5
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Building tables by using innerHTML is not supported since you can not add thead, tbody or tfoot which are required and if left out of the code, the browser rendering engine will add these elements by default...

    Using innerHTML and appending a table to an already rendered document will not produce those required elements(which admittedly most people do not use but are added when the document is rendered)....

    If you wish to create a table you will need to use the DOM and createElement()... Elsewise, build the table and give the data cells ID's and use getElementById() to change the innerHTML of the data cells...

    .....Willy

  • #6
    New Coder
    Join Date
    Mar 2004
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Here is the code - maybe this helps

    <table width='800' cellpadding="0" cellspacing="0">
    <tr><td width="630" valign='top'>
    <div id="displayzone">
    &nbsp;
    </div>
    </td>
    <td>&nbsp; </td>
    </tr>
    </table>



    </body>
    <script language="JavaScript1.1" type="text/javascript">
    var r = new Array();
    var k = 0;

    function sort(){
    var dummy = new Array();
    for (var i=1;i<k;++i){
    for (var j=i+1;j<k+1;++j){
    if (r[i][2]>r[j][2]){
    dummy=r[i];
    r[i]=r[j];
    r[j]=dummy;
    }
    }
    }
    }


    function showresults(){
    sort();
    var s="<table width='626' cellpadding='0' cellspacing='1'>";
    var s=s+"<tr bgcolor='#284386' class='title'><td>&nbsp;Nr&nbsp;</td><td>&nbsp;Merchant&nbsp;</td><td>&nbsp;Airline&nbsp;</td><td>&nbsp;Price in US$&nbsp;</td><td>&nbsp;Info&nbsp;</td><td>&nbsp;Email&nbsp;</td></tr>";
    var kback=0;
    var background="";
    for (var i=1;i<k+1;++i){
    if (kback==0){
    kback=1;
    background="#E4ECF3";
    } else {
    kback=0;
    background="#EDF1F5";
    }
    s=s+"<tr class='text' bgcolor='"+background+"'><td align='right'>"+i+".&nbsp;</td><td>&nbsp;"+r[i][0]+"</td><td>&nbsp;"+r[i][1]+"</td><td>&nbsp;"+r[i][2]+"</td><td>&nbsp;<a href=''><font size=2 color='#ff6300'><b>details</b></font></a></td><td align='center'><img src='/_temp/emailtof.gif' border=0 alt='Email this deal to a friend!'></td></tr>";
    }
    s=s+"</table>";
    displayzone.innerHTML=s;
    }
    </script>Thread TEST Module<br>
    #############RESULTS###############
    <div id="displayzone2">
    &nbsp;
    </div>
    ###################################<br>

    [1]Orbitz Done<br>ORBITZ PARSING START<br>
    <script language="JavaScript1.1" type="text/javascript">
    r[1]=new Array("Orbitz","United Airlines",104);
    r[2]=new Array("Orbitz","US Airways",104);
    r[3]=new Array("Orbitz","America West",104);
    r[4]=new Array("Orbitz","Northwest Airlines",104);
    r[5]=new Array("Orbitz","American Airlines",104);
    r[6]=new Array("Orbitz","United Airlines",114);
    r[7]=new Array("Orbitz","America West",114);
    r[8]=new Array("Orbitz","American Airlines",114);
    k=8;
    showresults();
    </script>ORBITZ PARSING DONE<br>[1]Intratours Done<br>INTRATOURS PARSING START<br>
    <script language="JavaScript1.1" type="text/javascript">
    r[9]=new Array("Intratours","United Airlines",138.20);
    r[10]=new Array("Intratours","US Airways",138.20);
    r[11]=new Array("Intratours","America West Airlines",138.20);
    r[12]=new Array("Intratours","American Airlines",128.20);
    k=12;
    showresults();
    </script>INTRATOURS PARSING DONE<br>[1]travelnow done<br>TRAVELNOW PARSING<br>
    <script language="JavaScript1.1" type="text/javascript">
    r[13]=new Array("Travelnow","AMERICA WEST",108.2);
    r[14]=new Array("Travelnow","NORTHWEST",108.2);
    r[15]=new Array("Travelnow","US AIRWAYS",108.2);
    r[16]=new Array("Travelnow","UNITED AIRLINES",108.2);
    r[17]=new Array("Travelnow","AMERICAN AIRLINES",108.2);
    r[18]=new Array("Travelnow","AMERICA WEST",118.2);
    r[19]=new Array("Travelnow","DELTA AIRLINES",119.3);
    r[20]=new Array("Travelnow","DELTA AIRLINES",141.2);
    r[21]=new Array("Travelnow","DELTA AIRLINES",155.2);
    r[22]=new Array("Travelnow","UNITED AIRLINES",160.2);
    k=22;
    showresults();
    </script>travelnow parse done<br>[1]cheapseats done<br>1800CHEAPSEATS PARSING START<br>

    <script language="JavaScript1.1" type="text/javascript">
    r[23]=new Array("1800CheapSeats","America West Airlines",98.2);
    r[24]=new Array("1800CheapSeats","Northwest Airlines",98.2);
    r[25]=new Array("1800CheapSeats","United Airlines",98.2);
    r[26]=new Array("1800CheapSeats","US Airways",98.2);
    r[27]=new Array("1800CheapSeats","American Airlines",98.2);
    r[28]=new Array("1800CheapSeats","US Airways",108.2);
    r[29]=new Array("1800CheapSeats","United Airlines",108.2);
    r[30]=new Array("1800CheapSeats","United Airlines",131.2);
    r[31]=new Array("1800CheapSeats","United Airlines",135.2);
    r[32]=new Array("1800CheapSeats","United Airlines",145.2);
    r[33]=new Array("1800CheapSeats","US Airways",145.2);
    k=33;
    showresults();
    </script>1800CHEAPSEATS PARSING DONE<br><br>Listing running threads<br>[1:2:3:4:5:]<br>Engines status:<br>Orbitz: 1<br>Travelnow: 1<br>Cheapseats: 1<br>Intratours: 1<br>Priceline: 0<br>


  •  

    Posting Permissions

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