December 18, 2019 Blog FileMaker FileMaker 17 FileMaker 18 FileMaker Techniques #copyFilemakerHTMLJavaJavaScriptJS Copy & Paste JavaScript into FileMaker How to easily copy JavaScript & HTML code into FileMaker Here’s a nice trick I learned from Chris Irvine (scalefm.com) on how to quickly copy HTML and Javascript code into your FileMaker scripts. To copy HTML and Javascript code into my FileMaker databases, I used to use a text editor to escape all double quotes (") by prepending them with a backslash (\"). Not doing that will cause an error message to pop up because FileMaker thinks that I’m using double quotes to add a text string ("id="123"" should be "id=\"123\"")). While a code editor’s replace all function is useful, it gets very annoying after a few iterations in my JavaScript code. Example of escaped double quotes Doing that every time in my code editor is a major pain, and thankfully there’s a way around that! Insert Text []: You can copy and paste text into the Insert Text script step without having to escape double quotes or surrounding the code with double quotes. Just copy and paste your code You can choose to set a variable or a field with that text. Either way, this makes my development flow much more efficient, and it’s an easy way to copy and paste HTML or JavaScript code into your FileMaker solution. By Karl Jreijiri
2 Comments Adrian Posted on 11:39 PM - December 26, 2019 Great workaround. However i mostly want my HTML to include fields values. So maybe i would do substitute references to make that work. MohammadAminMustaqim Posted on 6:07 PM - June 4, 2020 you can use as a text data.. then put on web viewer, no need “\”