Bookmarks work when the user is offline. The trick with the bookmarklet is that it fully contains javascript wrapped in such a way that it can live inside the bookmark itself. For instance. a javacsript:URL. You can also use the data:URL as a bookmark, which can be a full HTML page. This is usually base64 encoded with the mime type.
, data:text/html,base64, , , "" , .