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

Jon in Chicago, July 2008

I'm Jon Hartmann and I'm a C# .Net developer by day, a ColdFusion guru by night, and all around Javascript fanatic. Stay right here to read my technical posts as I grapple with mysterious error messages, user interface design questions, and all things baffling and irksome about programming for the web. Learn more about me.

Post a job. Find one. authenticjobs.com

Interested in becoming a sponsor? Contact me.