using refresh to reload page, problem is it loads header, footer andeverything, can I avoind those t

Discussion in 'HTML' started by VT, Oct 10, 2010.

  1. VT

    VT Guest

    Curently I am using refresh button to refresh the page, but the
    problem is, every time whole page header image and footer image gets
    refresh, but I want to update only few readings, my code is writtem in
    HTML, any alternative without refresh, this is my html code, please
    let me know without load header and footer, how can I reload only my
    readings?.




    <html>

    <head>
    <meta http-equiv="refresh" content="5">
    <title>BPSYSTEMS</title>
    </head>

    <body>
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    <br>

    <div align="left">
    <a href="/plugv3.htm"><strong>Click here for Plug Controls</strong> </
    a>
    <br>
    <a href="/board1_info.htm"><strong> Click here for Plug Currents &
    Powers</strong> </a>
    <br>
    <a href="/totals.htm"><strong> Click here for Total Currents, Total
    Powers & Board Volatges</strong> </a>
    </div>

    <div align="center">
    <b><font size="6"> STATUS page </font></b>
    <br><br>
    </div>

    <div align="center">

    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <td> <strong>PLUG 1 Status</
    strong> <input type="button" value="OFF" style="background-color:
    #cc0000; color: #ffffff;" /
    >

    </td>
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<td>
    <strong>PLUG 9 Status</strong> <input type="button" value="OFF"
    style="background-color: #cc0000; color: #ffffff;" /
    >

    </td>
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <td>
    <strong>PLUG 17 Status</strong> <input type="button" value="OFF"
    style="background-color: #cc0000; color: #ffffff;" /
    >

    </td>
    <br>
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<td> <strong>PLUG 2
    Status</strong> <input type="button" value="OFF" style="background-
    color: #cc0000; color: #ffffff;" /
    >

    </td>
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<td> <strong>PLUG 10
    Status</strong> <input type="button" value="OFF" style="background-
    color: #cc0000; color: #ffffff;" /
    >

    </td>
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<td> <strong>PLUG 18
    Status</strong> <input type="button" value="OFF" style="background-
    color: #cc0000; color: #ffffff;" /
    >

    </td>
    <br>


    <br>


    <br>

    <div align="center">
    <input type="button" value="Refresh"
    onclick="window.location.reload();" />
    </div>
    <br><br>

    <form name="input" action="/plug_login.htm" method="get">
    <div align="center">
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <input
    type="button" onclick="if (confirm('Sure you want to Logout?'))
    submit();" value="Logout"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp;
    </div>
    </form>

    <br>
    <tr> <CENTER>
    <td align="center" width="100%" colspan="2">
    <img border="0" src="footer.gif" width="800" height="25"></td> </
    CENTER>
    </tr>



    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<td> .
     
    VT, Oct 10, 2010
    #1
    1. Advertising

  2. Re: using refresh to reload page, problem is it loads header, footer and everything, can I avoind those to reload?

    "Sherm Pendley" <> wrote in message
    news:...
    > VT <> writes:
    >
    >> Curently I am using refresh button to refresh the page, but the
    >> problem is, every time whole page header image and footer image gets
    >> refresh, but I want to update only few readings, my code is writtem in
    >> HTML, any alternative without refresh

    >
    > Have a read about AJAX:
    >
    > <http://en.wikipedia.org/wiki/AJAX>


    I'm not familiar with AJAX, but here is a simple demo that can send and
    receive data to/from a separate pop-up window. The main window uses
    JavaScript, but the popup is simple HTML. Buttons on the main window open
    and close the pop-up, send data to it, and retrieve data from it. There is
    also a button to focus the pop-up if it is hidden.

    http://www.pauleschoen.com/SCGBG/PopupWindowSendData.htm

    You might need CGI to obtain the readings if your HTML and the source of
    your readings reside on a remote host. If your refresh button already
    updates the readings, you could incorporate that in the popup, which should
    refresh very quickly. You can also refresh the popup from the main page by
    using the "Open Window" button. You might then need to use the "Get Data"
    button. Or combine the functions, but there might be a timing problem if you
    open the popup window and try to read the data before it is ready.

    Good luck,

    Paul
     
    Paul E. Schoen, Oct 11, 2010
    #2
    1. Advertising

  3. Re: using refresh to reload page, problem is it loads header, footer and everything, can I avoind those to reload?

    I found the following tutorial which has a demo and source code:
    http://www.xul.fr/en-xml-ajax.html

    It reads the text in a file "data.xml" into a text box, using:

    document.ajax.dyn.value="Started...";
    if(window.XMLHttpRequest)
    req = new XMLHttpRequest();
    else if (window.ActiveXObject)
    req = new ActiveXObject(Microsoft.XMLHTTP);
    ...
    req.open("GET", "data.xml", true);
    req.setRequestHeader("Content-Type",
    "application/x-www-form-urlencoded");

    It is different for IE and other browsers.

    There are other examples that read "data.txt" and which write the data to
    the HTML body. Another demo sends the text from the web page to a file on
    the server. That uses a PHP script:

    xhr.open("POST", "ajax-post-text.php", true);
    xhr.setRequestHeader("Content-Type",
    "application/x-www-form-urlencoded");
    xhr.send(data);

    I'm not sure what the advantages of Ajax may be over using JavaScript in the
    web page and CGI scripts on the server. It took me a couple of months to get
    "up to speed" with a minimal level of competence. Of course that goes
    off-topic for HTML, but they are closely related. I've enjoyed learning
    these languages, although they have annoying quirks and things don't work
    like I'm used to with C and Delphi Pascal.

    Paul
     
    Paul E. Schoen, Oct 11, 2010
    #3
  4. VT

    VT Guest

    Re: using refresh to reload page, problem is it loads header, footerand everything, can I avoind those to reload?

    I have webpage with header image and footer image, middle content is
    real-time values few varialble, I need thm for every 5 or 6 seconds
    update on web page, currently using refresh tag, any otherway without
    refresh I can reload those variables, the problem right now is, this
    refresh reloads header and footer everytime, I get white blank page
    for one second with every reload, can I use any alternative to refresh
    to reload page without reload header and footer everytime.

    -------
    <--! refresh this page for every 5 seconds using refresh tag>

    header_image

    update variable1 10.0
    update variable2 20.0


    footer_image
    ----------
     
    VT, Oct 13, 2010
    #4
  5. VT

    VT Guest

    Re: using refresh to reload page, problem is it loads header, footerand everything, can I avoind those to reload?

    On Oct 11, 12:04 am, "Paul E. Schoen" <> wrote:
    > "Sherm Pendley" <> wrote in message
    >
    > news:...
    >
    > > VT <> writes:

    >
    > >> Curently I am using refresh button to refresh the page, but the
    > >> problem is, every time whole page header image and footer image gets
    > >> refresh, but I want to update only few readings, my code is writtem in
    > >> HTML, any alternative without refresh

    >
    > > Have a read about AJAX:

    >
    > >  <http://en.wikipedia.org/wiki/AJAX>

    >
    > I'm not familiar with AJAX, but here is a simple demo that can send and
    > receive data to/from a separate pop-up window. The main window uses
    > JavaScript, but the popup is simple HTML. Buttons on the main window open
    > and close the pop-up, send data to it, and retrieve data from it. There is
    > also a button to focus the pop-up if it is hidden.
    >
    > http://www.pauleschoen.com/SCGBG/PopupWindowSendData.htm
    >
    > You might need CGI to obtain the readings if your HTML and the source of
    > your readings reside on a remote host. If your refresh button already
    > updates the readings, you could incorporate that in the popup, which should
    > refresh very quickly. You can also refresh the popup from the main page by
    > using the "Open Window" button. You might then need to use the "Get Data"
    > button. Or combine the functions, but there might be a timing problem if you
    > open the popup window and try to read the data before it is ready.
    >
    > Good luck,
    >
    > Paul


    this doenot support CGI.
     
    VT, Oct 13, 2010
    #5
  6. Re: using refresh to reload page, problem is it loads header, footer and everything, can I avoind those to reload?

    "VT" <> wrote in message
    news:...
    On Oct 11, 12:04 am, "Paul E. Schoen" <> wrote:
    >
    > I'm not familiar with AJAX, but here is a simple demo that can send and
    > receive data to/from a separate pop-up window. The main window uses
    > JavaScript, but the popup is simple HTML. Buttons on the main window open
    > and close the pop-up, send data to it, and retrieve data from it. There is
    > also a button to focus the pop-up if it is hidden.
    >
    > http://www.pauleschoen.com/SCGBG/PopupWindowSendData.htm
    >
    > You might need CGI to obtain the readings if your HTML and the source of
    > your readings reside on a remote host. If your refresh button already
    > updates the readings, you could incorporate that in the popup, which
    > should
    > refresh very quickly. You can also refresh the popup from the main page by
    > using the "Open Window" button. You might then need to use the "Get Data"
    > button. Or combine the functions, but there might be a timing problem if
    > you
    > open the popup window and try to read the data before it is ready.
    >
    > Good luck,
    >
    > Paul


    this doenot support CGI.

    I did not look very closely at your HTML, and it appears that you have
    buttons which open web pages which display your data:

    <a href="/plugv3.htm">
    <a href="/board1_info.htm">
    <a href="/totals.htm">

    When you refresh the form, this action takes place.
    <form name="input" action="/plug_login.htm" method="get">

    Normally I think an action would be a CGI script rather than a web page. But
    this appears to be a login that may or may not return to your main page. I
    don't see any variable names or text boxes here that would display the
    readings you want. They must be obtained by the web pages you open with the
    three buttons and their associated href URLs. If you want to get those
    values you could use the methods I demonstrate in the web page linked above,
    and I am not using CGI. But you have to get the data from somewhere, so
    either a CGI script is called from those web pages or those pages are being
    dynamically created with new data, which would still require some means to
    access your instruments and write a file with the data.

    If you could provide all the files, or a link to your application, it would
    help to determine how to do what you want.

    Paul
     
    Paul E. Schoen, Oct 13, 2010
    #6
  7. VT

    VT Guest

    Re: using refresh to reload page, problem is it loads header, footerand everything, can I avoind those to reload?

    THose THree are links to other files, the action one is, incase if
    used press logout, then it should take to login page. Here is my
    readings page.I pasted html code here (here fourth line is refresh tag
    to reload page):


    <html>

    <head>
    <meta http-equiv="refresh" content="10">
    <title>BPS</title>
    </head>

    <body>

    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    <br>
    <div id="header">
    <CENTER><a title="BPS"><img src="header.gif" alt="BPS" width="800"
    height="64" border="0" /></a> </CENTER>
    </div> &nbsp; &nbsp; &nbsp;

    <div align="left">
    <a href="/plugv3.htm" onMouseOver="window.status='';return
    true;"><strong>Click here for Receptacle Controls</strong> </a>
    <br>
    <a href="/admin_status.html" onMouseOver="window.status='';return
    true;"><strong>Click here for Receptacle Status</strong> </a>
    <br>
    <a href="/board1_info.htm" onMouseOver="window.status='';return
    true;"><strong>Click here for Receptacle Currents & Powers</strong> </
    a>
    </div>

    <div align="center">
    <b><font size="3"> BOARD VOLTAGES (RMS), BOARD CURRENTS (RMS) and
    BOARD ACTUAL POWER readings </font></b>
    <br><br>
    </div>
    <br>
    <br>

    <div align="center">
    <TABLE>
    <tbody>
    <tr><td><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FIRST BOARD (Receptacles
    1-8) VOLTAGE (V1) : </strong></td><td>1 Volts</td> </tr>
    <tr><td><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SECOND BOARD
    (Receptacles 9-16) VOLTAGE (V2) : </strong></td><td>97 Volts</td></
    tr>
    <tr><td><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;THIRD BOARD (Receptacles
    17-24) VOLTAGE (V3): </strong></td><td>1 Volts</td></tr>
    </tbody>
    </TABLE>

    <br>
    <br>
    <TABLE>
    <tbody>

    <tr><td><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FIRST BOARD TOTAL
    CURRENT (RMS): </strong></td><td>0 </td><td>.</td><td>6 Amps</
    td></tr>
    <tr><td><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SECOND BOARD TOTAL
    CURRENT (RMS): </strong></td><td>0 </td><td>.</td><td>6 Amps</
    td></tr>
    <tr><td><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;THIRD BOARD TOTAL
    CURRENT (RMS): </strong></td><td>0 </td><td>.</td><td>4 Amps</
    td></tr>
    <tr><td><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL CURRENT (RMS): </
    strong></td><td>0 </td><td>.</td><td>8 Amps</td></tr>


    </tbody>
    </TABLE>
    <br>
    <br>
    <TABLE>
    <tbody>

    <tr><td><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FIRST BOARD
    POWER: </strong></td><td>0 Watts</td></tr>
    <tr><td><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SECOND BOARD
    POWER: </strong> </td><td>4 Watts</td></tr>
    <tr><td><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;THIRD BOARD
    POWER: </strong> </td><td>0 Watts</td></tr>
    <tr><td><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL BOARD
    POWER: </strong> </td><td>4 Watts</td></tr>

    </tbody>
    </TABLE>
    </div>






    <br><br>

    <div align="center">
    <input type="button" value="Refresh"
    onclick="window.location.reload();" />
    </div>
    <br><br><br>

    <form name="input" action="/plug_login.htm" method="get">
    <div align="center">
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <input
    type="button" onclick="if (confirm('Sure you want to Logout?'))
    submit();" value="Logout"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp;
    </div>
    </form>

    <br><br><br>
    <tr> <CENTER>
    <td align="center" width="100%" colspan="2">
    <img border="0" src="footer.gif" width="800" height="25"></td> </
    CENTER>
    </tr>
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<td> .
     
    VT, Oct 13, 2010
    #7
  8. Re: using refresh to reload page, problem is it loads header, footer and everything, can I avoind those to reload?

    "Sherm Pendley" <> wrote in message
    news:...
    > "Paul E. Schoen" <> writes:
    >
    >> Normally I think an action would be a CGI script rather than a web
    >> page.

    >
    > Nope. An action points to a URL - it doesn't matter how the contents
    > of that URL happen to be produced. It could be a static page, a CGI,
    > an Apache or IIS module, a Java servelet, magic pixie dust - anything.
    > Well, OK, that last one is pretty unlikely. :)


    I agree, although http://www.floobydust.com/ may be involved. The OP
    provided a sample of one of the web pages that are being displayed when one
    of the buttons is pressed. The values appear to be hard coded in the HTML,
    so I suspect that the page is being updated(rewritten) by some sort of
    script. Since apparently CGI is not supported, this must be a client-side
    application, and it could be a script or a compiled program that has hooks
    to the hardware. This page also has a refresh header with 10 second update,
    but the only action that appears to invioke is a reference to the login
    page. There is also a refresh button on that page. But the content must be
    dynamically generated unless this is a demo where hard coded values are
    used.

    It would be simple enough to get the data from this web page by using the
    JavaScript in my example. It would be easy to have the button click do this,
    or set up a timer to do it every few seconds. But my example may only work
    if the window with the data is a "child" of the "parent" window which
    creates it.

    Paul
     
    Paul E. Schoen, Oct 13, 2010
    #8
  9. Re: using refresh to reload page, problem is it loads header, footer and everything, can I avoind those to reload?

    "Sherm Pendley" <> wrote in message
    news:...
    > "Paul E. Schoen" <> writes:
    >
    >> Since apparently CGI is not supported, this must
    >> be a client-side application

    >
    > Not necessarily. "CGI" isn't a generic term that applies to any and
    > all dynamic server-side processing, it's just one specific type:
    >
    > <http://en.wikipedia.org/wiki/Common_Gateway_Interface>
    >
    > A hosting provider that doesn't support user-supplied CGIs could still
    > provide, for example, support for PHP pages that are processed by the
    > Apache mod_php module. That's a *very* common scenario where content
    > is produced dynamically without a single CGI script in sight.


    That's certainly true for "canned" processes, but isn't PHP just another
    scripting language? Since the OP's application seems to be reading various
    transducers for voltage, current, and power, it is almost certainly a custom
    application, although it may be part of a self-contained system that may
    reside on a remote server.

    One thing that set off alarms in my head was the title of the main HTML
    page: BPSYSTEMS. And it refers to plug currents and powers, and board
    voltages, so this may be a monitor for an oil drilling rig. If so, it does
    not inspire much confidence in the future for BP. I'll wager they spent more
    money on a fancy "footer.gif" than on this web page development.

    Paul
     
    Paul E. Schoen, Oct 14, 2010
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joshua Beall
    Replies:
    26
    Views:
    220,607
    AndreiKaa
    Jun 29, 2007
  2. BinnuChowdary
    Replies:
    1
    Views:
    542
    Swanand Mokashi
    May 1, 2006
  3. BinnuChowdary
    Replies:
    0
    Views:
    418
    BinnuChowdary
    May 2, 2006
  4. BinnuChowdary
    Replies:
    1
    Views:
    550
    =?UTF-8?B?R8O2cmFuIEFuZGVyc3Nvbg==?=
    May 2, 2006
  5. Henrik
    Replies:
    1
    Views:
    427
    Ken Cox [Microsoft MVP]
    Jul 6, 2006
Loading...

Share This Page