{"id":224,"date":"2010-06-16T11:15:00","date_gmt":"2010-06-16T15:15:00","guid":{"rendered":"http:\/\/erics-test-lab.com\/?p=224"},"modified":"2010-06-16T11:15:00","modified_gmt":"2010-06-16T15:15:00","slug":"using-cf-iif-with-javascript-fuctions","status":"publish","type":"post","link":"https:\/\/www.esearing.com\/v2010\/2010\/06\/using-cf-iif-with-javascript-fuctions\/","title":{"rendered":"Using CF IIF with Javascript Functions"},"content":{"rendered":"<p>I get bored writing CFIF statements so thought I would try using the old IIF method. Despite the arguments about performance it works quite well if you are not running it through thousands of iterations. I also had need to call a javascript function if a variable met some criteria. This is a simplified example.<\/p>\n<p><code>&lt;cfset myvar = \"abc\"><br \/>\n&lt;cfoutput><br \/>\n#iif(myvar is \"abc\",<br \/>\nDE(\"&lt;script>getx('a');&lt;\/script>\"),<br \/>\nDE(\"&lt;script>getx('Z');&lt;\/script>\")<br \/>\n)#<br \/>\n&lt;\/cfoutput><\/code><br \/>\ngetx(val) is a javascript function in my head tags.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I get bored writing CFIF statements so thought I would try using the old IIF method. Despite the arguments about performance it works quite well if you are not running it through thousands of iterations. I also had need to &hellip; <a href=\"https:\/\/www.esearing.com\/v2010\/2010\/06\/using-cf-iif-with-javascript-fuctions\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,16,24],"tags":[],"class_list":["post-224","post","type-post","status-publish","format-standard","hentry","category-code","category-coldfusion","category-snippets-quick-code-tips-for-single-elements-attributes-or-details"],"_links":{"self":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts\/224","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/comments?post=224"}],"version-history":[{"count":0,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts\/224\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/media?parent=224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/categories?post=224"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/tags?post=224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}