Dynamically update the URL of the Object Element for HTML content

Discussion in 'JavaScript' started by bstanek, Mar 9, 2007.

  1. #1
    I'm looking to dynamically update a table in my HTML page.

    To do this, instead of using an iFrame I am using the HTML Object Element
    as follows:

    <object id="mytest3" classid="clsid:25336920-03F9-11CF-8FD0-00AA00686F13"
    type="text/html"
    data="http://localhost/test_table.html" style="width:280px;height:180px;">
    </object>


    This is all working just fine when hard-coded.

    My problem is that I can't get the table to update dynamically.
    I've tried to replace the URL shown above as follows:

    window.document.mytest3.SetVariable
    ( "data", "http://localhost/test_table_2.html");

    When I do this, nothing happens. No refresh.

    Can anybody help?

    Thanks


    -----------------------------------------------------------------------

    Also, for those who may be interested, there are some tricks for the HTML document called by the Object element above in order to get:

    1. The Object Element to display consistently in both IE and Firefox
    2. The table data to right-align in both IE and Firefox

    The following code words for test_table.html:

    <html>
    <head>
    <style type="text/css">
    <!--
    col.numerical { text-align:right; }
    td:first-child + td { text-align:right; }
    td:first-child + td + td{ text-align:right; }
    td:first-child + td + td + td{ text-align:right; }
    -->
    </style>
    </head>
    <body style="border:0;overflow:visible;
    background-color: ACC05F; /*change the color to blend with your background*/
    margin: 0 auto 0 auto;">
    <table COLSPACING="2" CELLPADDING="2" border="0" style="font-size: 8pt; font-family: arial; cellspacing: 0; background-color: #ACC05F;">
    <col>
    <col class="numerical">
    <col class="numerical">
    <col class="numerical">
    <col align="left" width="80px"> </col><col> </col>
    <col> </col><col> </col>
    <tr style="font-weight: bold; ">
    <td>Period</td>
    <td>North</td>
    <td>South</td>
    <td>East</td>
    </tr>
    <tr>
    <td>Q1 </td>
    <td>10</td>
    <td>20</td>
    <td>30</td>
    </tr>
    <tr>
    <td>Q2</td>
    <td>100</td>

    <td>200</td>
    <td>300</td>
    </tr>
    <tr>
    <td>Q3</td>
    <td>1000</td>
    <td>2000</td>
    <td>3000</td>
    </tr>
    <tr>
    <td>Q4</td>

    <td>10000</td>
    <td>20000</td>
    <td>30000</td>
    </tr>
    </table>
    </body>
    </html>
     
    bstanek, Mar 9, 2007 IP
  2. joesgraphics

    joesgraphics Peon

    Messages:
    206
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi i cant help you with this but just fort i would say its better if you put the code in bbcode tags like

    [ CODE] for just randome code [/CODE]


    [ HTML]for html code [/HTML]


    [ PHP]for php code[/PHP]

    take the gaps out at the start

    just place you code in 1 that suits the code u need to show or u could just use the qick tabs in the editor its the 3 at the end just fort i would say :)
     
    joesgraphics, Mar 11, 2007 IP