Embedded Jquery - Web Viewer Coolness

Why on earth would you need/want to know about jquery? Isn't that something to do with the web?

You bet it does! And here's why you need to know about it. One, html/css/javascript skills are always a plus in the ever evolving technology landscape and two, because you can do some darn cool stuff within your FileMaker layouts which FileMaker can't do by itself - and probably won't for many, many years.

This video shows you how to get jquery, a Javascript library, into a global variable for reference within html - which can then be rendered within a Web Viewer. All without referencing any external urls or html files. It's 100% coolness right within FileMaker - and no plugins are required. This is a great way to test the waters and let your imagination run wild!

UPDATE: SPECIAL NOTICE ABOUT THE TECHNIQUE FILE

In the video, I showcase a method of pulling text from the inside of a text block (stored on the layout) in order to get Jquery into a global variable.

The method for doing this accounts for FileMaker's internal merge function within layout text objects. There are special characters, such as ##, //, :: and in particular ||. The double-pipes are converted in to the User Name, as set in the Preferences of the FileMaker client.

I point out, in the video, but not the technique file, that a better way to do this is to "force a known" substitution. This is because double-pipes may not be substituted due to lack of a User Name in FileMaker's Preferences.

In the original implementation I show, if your User name in preferences is blank, then Jquery won't load properly.

I've fixed the technique file to use a known substitution character to account for the double-pipe merge and I'd like to thank Bruce Robertson for sending me an alternative method to adding Jquery into a web viewer. I personally prefer to use the text block method because it has a lower implementation footprint. However, you should know that you can clearly use a dedicated table to store scripts and other code which can be dynamically integrated into web viewers and any other FileMaker aspect such as scripts, layouts and calcs!

AttachmentSize
EmbeddedJquery.zip280.03 KB

Comments

Just a public reminder to myself. Read the documentation! Special thanks to Alexander Zueiv for mentioning that "source", when used with text objects, bypasses the internal merge engine.


source - returns the source description of the specified object as follows. For:

web viewers
- returns current URL
fields
- returns the fully qualified field name (table name::field name)
text objects
- returns the text (does not return merge fields)
portals
- returns the related table name
graphics
- returns image data such as Container data type

-- Matt Petrowsky - ISO FileMaker Magazine Editor