WXforum.net

Web Weather => Weather Website PHP/AJAX scripting => Topic started by: rrrick8 on April 29, 2019, 09:01:07 AM

Title: Partial HTML page refresh?
Post by: rrrick8 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.
Title: Re: Partial HTML page refresh?
Post by: saratogaWX 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).
Title: Re: Partial HTML page refresh?
Post by: rrrick8 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.