{"id":12102,"date":"2020-11-24T17:56:13","date_gmt":"2020-11-24T17:56:13","guid":{"rendered":"https:\/\/www.directimpactsolutions.com\/?p=12102"},"modified":"2023-05-22T19:27:56","modified_gmt":"2023-05-22T19:27:56","slug":"how-to-debug-javascript-in-filemaker","status":"publish","type":"post","link":"https:\/\/www.directimpactsolutions.com\/en\/how-to-debug-javascript-in-filemaker\/","title":{"rendered":"How to Debug JavaScript in FileMaker"},"content":{"rendered":"<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/JavaScript-1024x683.jpg\" alt=\"How to debug JavaScript in FileMaker\" class=\"wp-image-12110\" width=\"619\" height=\"413\" srcset=\"https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/JavaScript-1024x683.jpg 1024w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/JavaScript-300x200.jpg 300w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/JavaScript-768x512.jpg 768w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/JavaScript-600x400.jpg 600w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/JavaScript.jpg 1500w\" sizes=\"auto, (max-width: 619px) 100vw, 619px\" \/><\/figure><p><strong>It\u2019s easy to debug and experiment with JavaScript code in a web browser, yet difficult to debug JavaScript in FileMaker. Here\u2019s a workaround.<\/strong><\/p><h3 class=\"wp-block-heading\">JavaScript<\/h3><p>Utilizing JavaScript in your FileMaker solution can open up an array of new possibilities for design and functionality. With a little bit (or a lot!) of HTML, CSS, and JavaScript, you can access design frameworks like&nbsp;<a href=\"https:\/\/getbootstrap.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Bootstrap<\/a>, or integrate different charting features using one of the many JavaScript-based chart libraries available.&nbsp;<\/p><p>JavaScript is a favorite among web developers, as most web browsers have built-in tools for debugging and experimenting with code. By right-clicking in the browser window, you can select the \u201cInspect,\u201d or \u201cInspect Element\u201d option to open developer tools in a side panel.<\/p><figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/safari-dev-tools.png\" alt=\"\" class=\"wp-image-12103\" width=\"749\" height=\"452\" srcset=\"https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/safari-dev-tools.png 1024w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/safari-dev-tools-300x181.png 300w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/safari-dev-tools-768x464.png 768w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/safari-dev-tools-600x362.png 600w\" sizes=\"auto, (max-width: 749px) 100vw, 749px\" \/><\/figure><p>Safari Development Tools<\/p><p>Debugging custom HTML, CSS, and&nbsp;JavaScript in FileMaker, however, is a little trickier. Since everything in FileMaker is routed through a text field, you don\u2019t get the built-in debugging tools of either a browser or an IDE, so you have to write your code elsewhere and copy\/paste it into your solution when it\u2019s ready. When you want to make changes, you have to jump back and forth between your IDE and your solution, going through too many steps to test small changes.&nbsp;<\/p><p>It is possible, however, to enable developer tools for&nbsp;<a href=\"https:\/\/directimpactsolutions.com\/en\/how-to-display-filemaker-data-on-the-web\">web viewers in FileMaker<\/a>, but it\u2019s sort of a hidden feature, and requires that you\u2019re on MacOS since FileMaker uses the same developer tools as Safari.<\/p><h3 class=\"wp-block-heading\">Here\u2019s how to show web development tools in FileMaker:<\/h3><ol class=\"wp-block-list\"><li>Make sure to quit FileMaker completely<\/li>\n\n<li>Open the terminal and type or copy\/paste the following command in a single line.&nbsp;<em>Note: .pro12 is the correct parameter for FileMaker 19<\/em>:<\/li><\/ol><pre class=\"wp-block-code\"><code>defaults write com.filemaker.client.pro12\n WebKitDebugDeveloperExtrasEnabled -bool YES<\/code><\/pre><p style=\"padding-left:var(--wp--preset--spacing--50)\">3. Test it out!<\/p><p style=\"padding-left:var(--wp--preset--spacing--50)\">Right click on the web viewer and you should see at least two options: \u201cReload\u201d and \u201cInspect\u201d. Click \u201cInspect\u201d and the developer tools will open in a separate window. If it opens as a panel, you can pop it out using the button in the top left corner for easier viewing.&nbsp;&nbsp;<\/p><figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/dev-tools-in-FM.png\" alt=\"\" class=\"wp-image-12105\" width=\"741\" height=\"649\" srcset=\"https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/dev-tools-in-FM.png 1024w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/dev-tools-in-FM-300x263.png 300w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/dev-tools-in-FM-768x674.png 768w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/dev-tools-in-FM-600x526.png 600w\" sizes=\"auto, (max-width: 741px) 100vw, 741px\" \/><\/figure><p>Development Tools in FileMaker<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"432\" height=\"302\" src=\"https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/dev-tools-window-mode-1.png\" alt=\"\" class=\"wp-image-12107\" srcset=\"https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/dev-tools-window-mode-1.png 432w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/dev-tools-window-mode-1-300x210.png 300w\" sizes=\"auto, (max-width: 432px) 100vw, 432px\" \/><\/figure><p>Development Tools in Window Mode<\/p><p>There are a few caveats:&nbsp;<\/p><ul class=\"wp-block-list\"><li>This only works in browse mode&nbsp;<\/li>\n\n<li>Be sure that the \u201cAllow interaction with web viewer content\u201d option is enabled in the web viewer setup<\/li>\n\n<li>If you navigate away from the web viewer you\u2019re inspecting, the inspector window will close. To mitigate this, it\u2019s a good idea to include debugging steps in your code, such as console.log(), or console.table(). W3schools has a simple&nbsp;<a href=\"https:\/\/www.w3schools.com\/js\/js_debugging.asp\" target=\"_blank\" rel=\"noreferrer noopener\">intro to debugging<\/a>, or check out this&nbsp;<a href=\"https:\/\/raygun.com\/learn\/javascript-debugging-tips\" target=\"_blank\" rel=\"noreferrer noopener\">more advanced guide<\/a>&nbsp;from Raygun<\/li><\/ul><hr class=\"wp-block-separator has-alpha-channel-opacity\" style=\"margin-top:var(--wp--preset--spacing--70);margin-bottom:var(--wp--preset--spacing--70)\"\/><p class=\"has-small-font-size\"><em>*This article was originally written for AppWorks, which has since joined Direct Impact Solutions. This article is intended for informative purposes only. To the best of our knowledge, this information is accurate as of the date of publication.<\/em><\/p>","protected":false},"excerpt":{"rendered":"<p>It\u2019s easy to debug and experiment with JavaScript code in a web browser, yet difficult to debug JavaScript in FileMaker. Here\u2019s a workaround. JavaScript Utilizing JavaScript in your FileMaker solution can open up an array of new possibilities for design and functionality. With a little bit (or a lot!) of HTML, CSS, and JavaScript, you &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/www.directimpactsolutions.com\/en\/how-to-debug-javascript-in-filemaker\/\"> <span class=\"screen-reader-text\">How to Debug JavaScript in FileMaker<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":6,"featured_media":12110,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"","footnotes":""},"categories":[29],"tags":[39,251,250,252],"class_list":["post-12102","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-low-code","tag-filemaker","tag-ios","tag-javascript","tag-web-browser"],"uagb_featured_image_src":{"full":["https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/JavaScript.jpg",1500,1000,false],"thumbnail":["https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/JavaScript-150x150.jpg",150,150,true],"medium":["https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/JavaScript-300x200.jpg",300,200,true],"medium_large":["https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/JavaScript-768x512.jpg",768,512,true],"large":["https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/JavaScript-1024x683.jpg",1024,683,true],"1536x1536":["https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/JavaScript.jpg",1500,1000,false],"2048x2048":["https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/JavaScript.jpg",1500,1000,false],"woocommerce_thumbnail":["https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/JavaScript-300x300.jpg",300,300,true],"woocommerce_single":["https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/JavaScript-600x400.jpg",600,400,true],"woocommerce_gallery_thumbnail":["https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/JavaScript-100x100.jpg",100,100,true]},"uagb_author_info":{"display_name":"Direct Impact Solutions","author_link":"https:\/\/www.directimpactsolutions.com\/en\/author\/direct-impact-solutions\/"},"uagb_comment_info":0,"uagb_excerpt":"It\u2019s easy to debug and experiment with JavaScript code in a web browser, yet difficult to debug JavaScript in FileMaker. Here\u2019s a workaround. JavaScript Utilizing JavaScript in your FileMaker solution can open up an array of new possibilities for design and functionality. With a little bit (or a lot!) of HTML, CSS, and JavaScript, you&hellip;","_links":{"self":[{"href":"https:\/\/www.directimpactsolutions.com\/en\/wp-json\/wp\/v2\/posts\/12102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.directimpactsolutions.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.directimpactsolutions.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.directimpactsolutions.com\/en\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.directimpactsolutions.com\/en\/wp-json\/wp\/v2\/comments?post=12102"}],"version-history":[{"count":3,"href":"https:\/\/www.directimpactsolutions.com\/en\/wp-json\/wp\/v2\/posts\/12102\/revisions"}],"predecessor-version":[{"id":12346,"href":"https:\/\/www.directimpactsolutions.com\/en\/wp-json\/wp\/v2\/posts\/12102\/revisions\/12346"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.directimpactsolutions.com\/en\/wp-json\/wp\/v2\/media\/12110"}],"wp:attachment":[{"href":"https:\/\/www.directimpactsolutions.com\/en\/wp-json\/wp\/v2\/media?parent=12102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.directimpactsolutions.com\/en\/wp-json\/wp\/v2\/categories?post=12102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.directimpactsolutions.com\/en\/wp-json\/wp\/v2\/tags?post=12102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}