Integrating it into my site
I added the code above to as a js file in my theme and created a Diazo rule which only includes the js in the specific form. This may be overengineering but the snippet to included the js was added as a rapido block. This has become my practice because some characters in the path break the xsl in my rules.xml and I this is my work around to overcome that.
I'm sure I could use the resource registry but I often think about it after the fact.