Refresh A Browser Widget.

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Googie85
Posts: 227
Joined: Tue Aug 05, 2014 10:07 am

Refresh A Browser Widget.

Post by Googie85 »

Hi LiveCoders!

I am having a problem refreshing a webpage "TEST.html" in a browser widget. The html page displays an image "/1.jpg" , and this displays fine.

I am updating the /1.jpg file, but, the webpage "TEST.html" does not refresh to the newly updated "/1.jpg". I am trying to refresh the page so it will display the updated image file.

I hope I have explained my situation clearly!!

Any help is greatly appreciated!!

Thanks,

Googie.

EDIT: I am using the following code to send to the browser widget.

Code: Select all

   put ( specialFolderPath("documents") & slash & "TEST.html" ) into blah
   set the URL of widget "Browser" to blah
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Refresh A Browser Widget.

Post by richmond62 »

Why do I have a feeling that inserting a dummy HTML file between each refresh might make
all the difference?
strongbow
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 151
Joined: Mon Jul 31, 2006 1:39 am
Contact:

Re: Refresh A Browser Widget.

Post by strongbow »

Probably because blah doesn't contain a URL.

You need to prepend something like "file:" to your variable "blah".
mrcoollion
Posts: 744
Joined: Thu Sep 11, 2014 1:49 pm

Re: Refresh A Browser Widget.

Post by mrcoollion »

Just a small addition to this topic beause i am working on this 'issue'.

If you just want to refresh the browser widget using the url already set you could use the following.

Code: Select all

On Mouseup
   RefreshBrowser "Name"
end Mouseup

command RefreshBrowser BrowserWidgetName
   put the url of widget BrowserWidgetName into tBrowserUrl
   set the URL of widget BrowserWidgetName to tBrowserUrl
end RefreshBrowser
Regards,

Paul
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Refresh A Browser Widget.

Post by FourthWorld »

Browser engines are notorious for aggressive caching. I recently came across an annoying situation with a web app I've been working on where the layout didn't line up because even though the browser was getting the latest HTML it was still using a cache of an image file that had changed.

One way to prevent that is to modify the image URL by appending the src reference with a bogus query that's different each time the page is loaded:

https://instructobit.com/tutorial/119/F ... Javascript
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Post Reply