Getting Browser Widget to Read Local Assets

Sannyasin Brahmanathaswami brahma at hindu.org
Fri Jan 11 08:08:22 EST 2019


I finally got around to implementing this. Works great! In terms of being a loader for

on browserDocumentLoadComplete pURL
   if pURl is not empty then
      send "hideloader" to me in 1 second
   end if
[snip]

One caveat: Old path problem. I can't get the browser to read a local image in this case. Tried full path 

specialFolderPath("resources")

which yields this:

background-image
url( '/Users/brahmanathaswami/Documents/_Siva-Siva-App/assets/img/siva-darshan/who-is-siva_1200x800.jpg');

I tried a manual relative path

background-image
url( '../assets/img/siva-darshan/who-is-siva_1200x800.jpg');

against this folder layout  

assets
  img
     siva-darshan
	 who-is-siva_1200x800.jpg
view
  SivaSivaBrowser.livecode

It still doesn’t show?

	BR

 

 hh wrote:

    The following works tested here on desktop, should work everywhere where the browser widget works.
    
    1. Overlay browser widget "browser" with a browser widget "loader" (that displays a loading animation).
    2. Load the slow loading url into widget "browser".
    3. Hide widget "loader" by browserDocumentLoadComplete of widget "browser".
    
    For example:
    http://forums.livecode.com/viewtopic.php?p=173867#p173867



More information about the use-livecode mailing list