Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Dynamic Web Viewer Content (offline html generation without external files!)

Featured Replies

I did a little research (Google is our friend) and it is entirely possible to dynamically generate content inside a WebViewer object without resorting to HTTP calls or loading local files.

In other words, you can create any content you want (even graphics if you know the format) without requiring external files or even a connection to a web server.

The key is to use the DATA protocol. This article won't go into all the details; again, use a search engine for more information.

Attached is a sample file that will dynamically fill a box with a colour that you specify using hex. One field, one WebViewer object, and one button... no scripts, no exporting, no importing, no file references!

WebViewer.fp7.zip

Edited by Guest
clarification

Hi

it seems not working with IE, isn't it ?

  • Author

What a shame. I didn't test this on my Windows machine until now. Perhaps in the next release of IE they will include support for the data url.

Sorry folks, looks like this is a Mac OSX feature only for the time being!

  • Author

Just out of curiosity, why does

Bob

Edited by Guest

You RULE !

Thanks a lot Peter !

  • Author

Here's how I learned about the data URI scheme:

http://en.wikipedia.org/wiki/Uniform_Resource_Locator

and

http://en.wikipedia.org/wiki/Data:_URL

and

http://en.wikipedia.org/wiki/About:_URI_scheme

Fun reading!

  • Author

aw, shucks!

(glad to help!)

  • Author

Yes, I am using the latest version of XP Pro with all patches in place. I'll keep fiddling with the web viewer as I still can't get it to work. For now I'll just export my file and then load it as that works OK. Plus, I'll continue to follow this thread.

Thanks for the reply!

Very nice, works for me on the Mac.

  • 2 weeks later...

Peter,

this is a great find. I've tested it (on IE) and gotten it to make many colorful blank web pages. I am wondering, is there a way to make this idea help me populate fields that already exist on a webpage? I want to use the WebViewer to populate the fields in a form but the form uses the POST method, which doesn't allow me to paste things into the URL (not successfully, anyway). I would love it if I could simply populate the fields and only have to click on the submit button. Is there a way to do this with the method you've provided here? (or any other way you can think of?). TIA

-Peter (that's my name, too).

This works really well. Generating html code in a field to use for the display in the web viewer object and using css style sheets (held on a network drive) for formatting. Very nice indeed. Thanks for pointing to the possibilities.

rogermax, were you able to get this to work on XP with the demo file that TheBridge originally supplied? I can't get anything to happen on XP (with FM8.5A) and don't know why. If you're doing anything differently, maybe that will help me.

Thanks!

James

www.james-mc.com

Select document to view...

Thanks! I'll give it a try.

  • 3 weeks later...

I have posted some more examples inspired by this post

http://fmforums.com/forum/showpost.php?post/220339/

These are several methods for calling on an image (ore other media) that has its source stored in a field or is embedded in the web Viewer itself...

Took a few days to work out but it really could be quite useful.

There are a few things that others could help out on ... see file

best,

Stuart

  • 2 weeks later...

Hi,

Can someone post an About: URL in a file that works on their PC for me to look at as i am on a mac and want to build x platform but cant test.

Stuart

Hi,

Can someone post an About: URL in a file that works on their PC for me to look at as i am on a mac and want to build x platform but cant test.

Stuart

  • 1 month later...

#

if your using data your on a mac...

try replacing the space with %20

If you go to the web viewer help, look under "Defining a custom web address", there is a hyperlink to the topic "About URL Encoding in web viewers" that discusses what chars will be encoded.

What it says is: "A pound sign (#) is encoded only if a number character (0 through 9) follows it."

So, in this case (since you need it encoded), you could try to place numbers after each # if possible (that works in SVG).

this is starting to make sense. but in order have w3c compliant IDs, you can't have the id start with a number, which means I must do things like #foo, where foo is not a number. Any ideas how to accomplish that?

try

GetAsURLEncoded ( "#" )

i get %23

Edited by Guest

  • 2 weeks later...

when I convert my #'s to %23, the %23 just gets rendered to the page without converting it back to a #. :-(

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.