Utility Function: IncludeScript()

I use this one to dynamically include JS I need for a specific page. Its really just a specialized wrapper for <cfhtmlhead/> but I like it better.


<cffunction name="IncludeScript" access="public" output="false" returntype="void">
    <cfargument name="script" type="string" required="true" />
        
    <cfhtmlhead text="<script type=""text/javascript"" src=""#arguments.script#""></script>" />
        
    <cfreturn />
</cffunction>

 

Related Blog Entries

Comments are not allowed for this entry.
Jon Hartmann, July 2011

I'm Jon Hartmann and I'm a Javascript fanatic, UX/UI evangelist and former ColdFusion master. I blog about mysterious error messages, user interface design questions, and all things baffling and irksome about programming for the web.

Learn more about me on LinkedIn.