I have written much code in my time but can't be an expert at everything. I have now foundered on what is probably a simple matter for some.
I have some buttons on an Annex web page that change things. When they change, htmleventbutton$ tells me what has been pressed. I use that to modify some text and then want the web page to update some text to reflect the new reality. But repainting the screen doesn't do it, it still shows the old text even though the actual text is different, presumably because it is taking an earlier version from the browser cache. I have to do a refresh (F5) to get the updated screen, which does work.
How do I (in a very simple way) force the update to actually happen? i.e. make the f5 happen from within the paint code.
I'm sure (hope) this is very simple but all I can find are massively complex ways that some say work and some say don't.
Stuart
html help sought
- cicciocb
- Site Admin
- Posts: 1966
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 422 times
- Been thanked: 1311 times
- Contact:
Re: html help sought
Hi Stuart,
to refresh the page only a simple javascript command is required
to refresh the page only a simple javascript command is required
Code: [Local Link Removed for Guests]
jscall "location.reload();"
Code: [Local Link Removed for Guests]
' refresh the page "equivalent of F5"
onhtmlreload myrefresh
gosub myrefresh
wait
myrefresh:
cls
a$ = ""
a$ = a$ + "First Line<br>"
a$ = a$ + "Second Line<br>"
a$ = a$ + "Third Line<br>"
a$ = a$ + "Random " + str$(rnd(1000))
html a$
pause 1000
jscall "location.reload();" ' refresh the page
return
Re: html help sought
Thanks for that. I had found the command but wasn't sure how to use it. There are so many overcomplicated solutions out there.