HTMLViewGo and update
BlitzMax Forums/MaxGUI Module/HTMLViewGo and update| 
 | ||
| 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. | 
| 
 | ||
| Does it work if you navigate away from the page (to say another 'Loading' page) and then navigate back? | 
| 
 | ||
| The problem is then i am reload the same side. Any idea? | 
| 
 | ||
| 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 ^^ | 
| 
 | ||
| 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! | 
| 
 | ||
| HtmlViewRun htmlviewpreview, "window.location.reload();" | 
| 
 | ||
| Thanx @ BlueApple works great!!!! ;-) |