How to write code to refresh data only in web page.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Van Lee
    New Member
    • Dec 2010
    • 2

    #1

    How to write code to refresh data only in web page.

    PLEASE HELP!!!

    I am trying to refresh the data part only in my web page so that the pictures and the borders all stay. The refresh rate will need to be every 5 seconds so you can see that curently the page will refresh before the data is shown properly. I am very new to programming so any help would be appreciated!! The data is in [[number]]. The restrictions that I have are that I cannot use any sever side tricks. The web page will be stored on a remote piece of hardware and that is why the data is referenced in [[]]. I have been told to use frames...but I am have the hardest time in doing so.......

    Here is the code......

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Rig 391 Engine Page</title>
    </head>
    <body>
    <table
    style="text-align: left; width: 1373px;" border="1"
    cellpadding="2" cellspacing="2" >
    <tbody>
    <tr>
    <td
    style="width: 98px; text-align: center; vertical-align: middle; height: 36px; background-color: rgb(192, 192, 192);"><big><sp an
    style="font-weight: bold;"><br />
    </span></big></td>
    <td colspan="3" rowspan="1"
    style="backgrou nd-color: transparent; width: 409px; height: 36px;"></td>
    </tr>
    <tr>
    <td
    style="width: 98px; height: 17px; background-color: rgb(7, 12, 7);">
    <div style="text-align: center;"><small ><span
    style="font-weight: bold; color: rgb(58, 232, 0);" position=""
    absolute="" top="" 181px="" left=""
    1249px=""><big> <span
    style="font-weight: bold;">[[197]]</span></big><br />
    </span></small></div>
    <div
    style="position : absolute; top: 125px; left: 1262px;"><small ><big><span
    style="font-weight: bold;">[[166]]</span></big><br />
    </small></div>
    <div
    style="position : absolute; top: 182px; left: 828px;"><small> <big><span
    style="font-weight: bold;">[[202]]</span></big><br />
    </small></div>
    <div
    style="position : absolute; top: 126px; left: 836px;"><small> <big><span
    style="font-weight: bold;">[[165]]</span></big></small></div>
    </td>
    <td
    style="width: 409px; text-align: center; height: 17px; background-color: rgb(255, 204, 51);"><big><spa n
    style="font-weight: bold;">Engine 1</span></big></td>
    <td
    style="width: 415px; text-align: center; height: 17px; background-color: rgb(255, 204, 51);"><big><spa n
    style="font-weight: bold;">Engine 2</span></big></td>
    <td
    style="width: 415px; text-align: center; height: 17px; background-color: rgb(255, 204, 51);"><big><spa n
    style="font-weight: bold;">Engine 3</span></big></td>
    </tr>
    <tr>
    <td
    style="height: 126px; width: 98px; text-align: center; background-color: rgb(191, 191, 191);"><br />
    <div
    style="position : absolute; top: 194px; left: 14px;"><span
    style="font-weight: bold; color: rgb(0, 0, 0);">Engine
    Status</span><br />
    </div>
    <div
    style="position : absolute; top: 128px; left: 26px;"><span
    style="font-weight: bold; color: rgb(0, 0, 0);">Serial
    No.</span></div>
    </td>
    <td
    style="height: 126px; width: 409px; background-color: rgb(255, 204, 0);"><img
    style="width: 415px; height: 180px;" alt="Engine 1"
    src="Engine.jpg " /></td>
    <td
    style="height: 126px; width: 415px; background-color: rgb(255, 204, 0);"><img
    style="width: 415px; height: 180px;" alt="Engine 2"
    src="Engine.jpg " /></td>
    <td
    style="height: 126px; width: 415px; background-color: rgb(255, 204, 0);"><img
    style="width: 415px; height: 180px;" alt="Engine 3"
    src="Engine.jpg " /></td>
    </tr>
    <tr>
    <td
    style="height: 0px; width: 98px; text-align: center; font-weight: bold; background-color: rgb(191, 191, 191); color: rgb(0, 0, 0);">Engine
    Hours</td>
    <td
    style="height: 0px; width: 409px; text-align: center; font-weight: bold;"><big>[[24]]</big><br />
    <div
    style="position : absolute; top: 181px; left: 405px;"><big>[[201]]</big><br />
    </div>
    <div
    style="position : absolute; top: 125px; left: 412px;"><big>[[164]]</big></div>
    </td>
    <td
    style="height: 0px; width: 415px; text-align: center; font-weight: bold;">[[2]]</td>
    <td
    style="height: 0px; width: 415px; text-align: center; font-weight: bold;">[[45]]</td>
    </tr>
    <tr>
    <td
    style="width: 98px; text-align: center; font-weight: bold; background-color: rgb(191, 191, 191); color: rgb(0, 0, 0);">Engine
    Load</td>
    <td
    style="width: 409px; text-align: center; font-weight: bold;"><big><sp an
    style="font-weight: bold;">[[22]]</span></big></td>
    <td
    style="width: 415px; text-align: center; font-weight: bold;">[[1]]</td>
    <td
    style="width: 415px; text-align: center; font-weight: bold;">[[43]]</td>
    </tr>
    <tr>
    <td
    style="width: 98px; text-align: center; font-weight: bold; background-color: rgb(191, 191, 191); color: rgb(0, 0, 0);">Engine
    RPM</td>
    <td
    style="width: 409px; text-align: center; font-weight: bold;"><big>[[21]]</big></td>
    <td
    style="width: 415px; text-align: center; font-weight: bold;">[[0]]</td>
    <td
    style="width: 415px; text-align: center; font-weight: bold;">[[42]]</td>
    </tr>
    <tr>
    <td
    style="width: 98px; text-align: center; font-weight: bold; background-color: rgb(191, 191, 191); color: rgb(0, 0, 0);">Oil
    Pressure</td>
    <td
    style="width: 409px; text-align: center; font-weight: bold;"><big>[[25]]</big></td>
    <td
    style="width: 415px; text-align: center; font-weight: bold;">[[4]]</td>
    <td
    style="width: 415px; text-align: center; font-weight: bold;">[[46]]</td>
    </tr>
    <tr>
    <td
    style="width: 98px; text-align: center; font-weight: bold; background-color: rgb(191, 191, 191); color: rgb(0, 0, 0);">Fuel
    Pressure</td>
    <td
    style="width: 409px; text-align: center; font-weight: bold;"><big>[[26]]</big></td>
    <td
    style="width: 415px; text-align: center; font-weight: bold;">[[5]]</td>
    <td
    style="width: 415px; text-align: center; font-weight: bold;">[[47]]</td>
    </tr>
    <tr>
    <td
    style="width: 98px; text-align: center; font-weight: bold; background-color: rgb(191, 191, 191); color: rgb(0, 0, 0);">Cool.
    Temp</td>
    <td
    style="width: 409px; text-align: center; font-weight: bold;"><big>[[30]]</big></td>
    <td
    style="width: 415px; text-align: center; font-weight: bold;">[[9]]</td>
    <td
    style="width: 415px; text-align: center; font-weight: bold;">[[51]]</td>
    </tr>
    <tr>
    <td
    style="width: 98px; text-align: center; font-weight: bold; background-color: rgb(191, 191, 191); color: rgb(0, 0, 0);">Fuel
    Consp*</td>
    <td
    style="width: 409px; text-align: center; font-weight: bold;"><big>[[33]]</big></td>
    <td
    style="width: 415px; text-align: center; font-weight: bold;">[[12]]</td>
    <td
    style="width: 415px; text-align: center; font-weight: bold;">[[54]]</td>
    </tr>
    <tr>
    <td rowspan="1" colspan="4"><br />
    <table
    style="text-align: left; width: 92px; height: 60px;" border="1"
    cellpadding="2" cellspacing="2" >
    <tbody>
    <tr
    style="font-weight: bold; background-color: rgb(191, 191, 191);"
    align="center">
    <td><small><sma ll><small><smal l>VanView</small></small></small></small></td>
    </tr>
    <tr
    style="font-weight: bold; background-color: rgb(191, 191, 191);"
    align="center">
    <td><small><sma ll><small><smal l>RAMS&reg;
    EMS&nbsp;</small></small></small></small></td>
    </tr>
    <tr
    style="font-weight: bold; background-color: rgb(191, 191, 191);"
    align="center">
    <td><small><sma ll><small><smal l>Ver
    1.0</small></small></small></small></td>
    </tr>
    </tbody>
    </table>
    <br />
    <div
    style="position : absolute; top: 182px; left: 1252px;"><span
    style="font-weight: bold;">[[203]]</span><br />
    </div>
    <br />
    <small><small >*
    Fuel Consumption Rate Readinds Are Displayed In
    (g/hr)</small></small><br />
    <small><small>* *
    Oil And Fuel Pressure Readings Are Displayed In
    PSI. </small></small></td>
    </tr>
    </tbody>
    </table>
    </body>
    </html>
  • sephedo
    New Member
    • Dec 2010
    • 5

    #2
    you can use meta tags to refresh the page

    just add this to the top of your page

    Code:
    <meta http-equiv="refresh" content="2;url=http://google.co.uk">
    the content="2; bit is the time so currently it is set to 2 seconds and url=http://google.co.uk is the website address so change it to whatever you need it to refresh.

    as for keeping the rest of the page from refreshing just use frames like so

    Code:
    <frame src="http://google.co.uk" width="600" height="500" ></frame>
    hope this helps - this is all html so no server side code has been used

    EDIT: i forgot to mension using frames just create a new HTML document for example table.html and copy and paste your table html into it and add the meta tag above to it.

    Comment

    • Van Lee
      New Member
      • Dec 2010
      • 2

      #3
      Thanks for the help...I will give it a try!

      Comment

      Working...