HTMLViewGo and update

BlitzMax Forums/MaxGUI Module/HTMLViewGo and update

MacSven(Posted 2008) [#1]
I written a little htmlviewgo to preview a website, than i change something
in the html source , htmlviewgo will not update the page.



What happens. Is somthing wrong with my code. I have insert in the html source
the meta tag for nocache.


SebHoll(Posted 2008) [#2]
Does it work if you navigate away from the page (to say another 'Loading' page) and then navigate back?


MacSven(Posted 2008) [#3]
The problem is then i am reload the same side. Any idea?


danielos(Posted 2008) [#4]
you have to save the current html code as a temporal website anywhere on your harddisk, f.e. as temp.html.
If you call HtmlViewGo again and temp.html <> 0, you have to load temp.html,
else you can load the orginal page.
I have some code for this, have so search it though ^^


danielos(Posted 2008) [#5]
so here it is:
Global tempsite$=(SystemProperty$("TEMPDIR") + "\temp.html")

orgcontent$=TextAreaText(textarea) ;Original content, has to be defined just after the 
								   ; website is loaded


;---------------------------------------------------------------

If WebsiteLoaded=True
	
	TempString$=TextAreaText(Textarea) ; current content of the textarea that contains the html code
	
	If OrgContent$ <> TempString$ 	      ; if changes were made in the source code
		TempWebsite=WriteFile(tempsite$) 
		WriteString TempWebsite,TempString$ ;contents of textarea are copied to tempfile
	EndIf
	
EndIf
			

If EventSource()=apply
	
	TempSiteExists=FileType(tempsite$)
	If TempSiteExists <> 0
		HtmlViewGo htmlviewpreview,tempsite$
	Else
		HtmlViewGo htmlviewpreview,"index.html" ;original loaded website
	EndIf

EndIf



It should work, let me know!


Blueapples(Posted 2008) [#6]
HtmlViewRun htmlviewpreview, "window.location.reload();"



MacSven(Posted 2008) [#7]
Thanx @ BlueApple works great!!!!
;-)