Author Topic: Partial HTML page refresh?  (Read 329 times)

0 Members and 1 Guest are viewing this topic.

Offline rrrick8

  • Senior Contributor
  • ****
  • Posts: 224
    • Vermilion weather
Partial HTML page refresh?
« on: April 29, 2019, 09:01:07 AM »
Not to hijack this thread, but.... is there a way to have only a part of a page(s) refresh (i.e. Atom Alerts) but not the entire page?
I have many pages that have zoomable images that when the page auto refreshes, the image zoom defaults back to start.
Removing the header META refresh would stop that but it also stops the auto update of the top warning Atom Alerts which is a priority.


Ken, if you would rather have this as a separate thread that is ok.
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Partial HTML page refresh?
« Reply #1 on: April 29, 2019, 10:36:09 AM »
I did split off the topic to a new thread.

There are only two methods to update a page dynamically:
1) a <meta> tag with <meta http-equiv="Refresh" content="300" /> causes the browser to reload the entire page (and only the entire page) every 5 minutes.
2) an AJAX script can update part of the page at an interval based on dynamically loading some content and rewriting the HTML contents of the displayed page in the browser.  That's what the ajaxXXwx.js script does for various data items based on the weather-software's realtime file.

For Atom Alerts, it's a bit more complicated and depends on which script you're using (atom-alerts, atom-top-warnings, nws-alerts) -- they all produce HTML which is displayed when PHP includes them in the page.  The warning data itself is only updated at 5 or 10 minute intervals on the alerts server, so a 'realtime' partial update of the page wouldn't be more meaningful (or current) than just using a <meta> page refresh every 5 or 10 minutes (IMHO).
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline rrrick8

  • Senior Contributor
  • ****
  • Posts: 224
    • Vermilion weather
Re: Partial HTML page refresh?
« Reply #2 on: April 29, 2019, 10:44:07 PM »
Thanks for the reply Ken.
I use Curly's NWS-Alerts script. I don't need real time updating of the NWS-Alert script like you stated, but just need some way to keep it updating at a decent interval if I can keep the main content of a page from updating by doing away with the  META Refresh tag. No biggie though. Just need to rezoom on those certain images or frames that reload every 5 minutes.
Thanks.
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

 

anything