Refreshing question

Simon Smith hello at simonsmith.co
Wed Jul 12 16:10:53 EDT 2017


Hi

Couple of ways you could look at doing it.

Depending on the formatting of the page, you could use an iframe and just
get the page that is getting loaded each time to refresh with something
like <meta http-equiv="refresh" content="60" > - this would just reload the
section of the page and not the entire page.

You could also use a jquery to reload just a portion of the page and
something like:

<div id="content">
<!-- stuff in here is to be periodically refreshed -->
</div>

$(document).ready(function () {
    setInterval(function() {
        $("#content").load("http://mydomain.com/script.ls");
    }, 5000);
})


If the data that you are wanting to display is in XML, and you are just
wanting to load that XML file every minute, I would look at using Jquery's
AJAX functionality, (http://api.jquery.com/jquery.ajax/) wrapped
inside a setTimeout
function.

Simon


Carpe diem

*Simon Smith*
m. +27 83 306 7862

On Wed, Jul 12, 2017 at 6:42 PM, Jonathan Lynch via use-livecode <
use-livecode at lists.runrev.com> wrote:

> You can access the online data through LC, either synchronously or
> asynchronously, and process it as you need in LC.
>
> Then, you can send that data to the browser widget where you use
> Javascript to display it within the browser, by setting the innerHTML of a
> div or some other method.
>
> In this way, your data will update seamlessly without having any sort of
> obnoxious page reload. A page reload might not be bad for a simple page,
> but can be disruptive for a complex page.
>
> This method also minimizes the amount of data transferred, if that is an
> issue.
>
> Sent from my iPhone
>
> > On Jul 12, 2017, at 12:23 PM, jbv via use-livecode <
> use-livecode at lists.runrev.com> wrote:
> >
> >> On Wed, July 12, 2017 5:34 pm, jonathandlynch at gmail.com wrote:
> >> If the data is always the same, then I would update a page and have the
> >> browser read it.
> >>
> >> Are you looking to reload the whole page or just update a few data
> >> points?
> >>
> >
> > I really need to reload the xml data only, as the user will have the
> > possibility to make some choices and changes on the page, and according
> > to those changes, only some parts of the data will be displayed, or
> > will be displayed in a different way...
> >
> > Thanks
> > jbv
> >
> >
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the Use-livecode mailing list