how to load a local file into the browser widget?

Curt Ford curt at sonasoftware.com
Fri May 24 16:02:20 EDT 2019


Is there a trick to getting a local html file to display in the browser 
widget? I'm using this in a test button (in 9.0.4, on a Mac):

*on*mouseUp

*# set the defaultFolder to the folder containing the stackfile*

*set*theitemDelimitertoslash*
get*theeffectivefilenameofthisstack*
set*thedefaultFoldertoitem1to-2 ofit*
answer*"defaultFolder is"&& thedefaultFolder

*if* thereisafile"Future.html"*then**
answer*"OK, it's there"*
else**
answer*"not found!"*
end* *if*

*put*"file:/"& thedefaultFolder& slash& "Future.html"intotFile*
set*theURLofwidget"Browser"totFile*
answer*"the URL is"&& theURLofwidget"Browser"

*end*mouseUp

The .html file is in the same folder with the stack file, and in the 
standalone I've copied it into the bundle & the stack seems to find it, 
but nothing displays in the widget, both in IDE and the standalone. 
Loading a remote location works fine with

*put*"https://nytimes.com"intotFile

*set*theURLofwidget"Browser"totFile

Is there something else to keep in mind when displaying a local file?

Curt


-- 
Sent from Postbox 
<https://www.postbox-inc.com/?utm_source=email&utm_medium=siglink&utm_campaign=reach>



More information about the use-livecode mailing list