Page 1 of 1

Refresh A Browser Widget.

Posted: Wed May 25, 2022 8:24 am
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

Re: Refresh A Browser Widget.

Posted: Wed May 25, 2022 8:56 am
by richmond62
Why do I have a feeling that inserting a dummy HTML file between each refresh might make
all the difference?

Re: Refresh A Browser Widget.

Posted: Thu May 26, 2022 6:18 am
by strongbow
Probably because blah doesn't contain a URL.

You need to prepend something like "file:" to your variable "blah".

Re: Refresh A Browser Widget.

Posted: Sun Mar 05, 2023 12:24 pm
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

Re: Refresh A Browser Widget.

Posted: Sun Mar 05, 2023 6:38 pm
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