cfajaximport

Description

Controls the JavaScript files that are imported for use on pages that use ColdFusion AJAX tags and features.

Categories

Related

History

ColdFusion 8: Added this tag.

Syntax

<cfajaximport 
    cssSrc = "local URL path" 
    params = "parameters" 
    scriptSrc = "local URL path" 
    tags = "comma-delimited list">
Note: You can specify this tag’s attributes in an attributeCollection whose value is a structure. Specify the structure name in the attributeCollection and use the tag’s attribute names as structure keys.

Attributes

AttributeDescriptionRequiredDefault
cssSrcSpecifies the URL, relative to the web root, of the directory that contains the CSS files used by ColdFusion AJAX features, with the exception of the rich text editor. This directory must have the same directory structure, and contain the same CSS files, and image files required by the CSS files, as the web_root/CFIDE/scripts/ajax/resources directory. This attribute lets you create different custom styles for ColdFusion AJAX controls in different applications.Optionalscriptsrc/ajax
paramsThis attribute allows you to specify parameters for the CFM page. Currently, the only parameter that you can specify is googlemapkey. You can specify the googlemapkey as follows: <cfajaximport params=#{googlemapkey="Map API Key"}#>Optional 
scriptSrcSpecifies the URL, relative to the web root, of the directory that contains the client-side script files used by ColdFusion. This directory includes the JavaScript files and the default location of the CSS files used for all AJAX features. If you use this attribute, the cfajaximport tag must precede all other ColdFusion AJAX tags on the page; that is, all tags that rely on the scripts. You can have only one scriptsrc attribute on a page, in a cfajaximport tag or a cfform tag. You can use a scriptsrc attribute in a cfajaximport tag to apply its value to all forms on a page.Optionalscriptsrc setting in the Administrator; default path is /CFIDE/scripts/
tagsA comma-delimited list of tags or tag-attribute combinations for which to import the supporting JavaScript files on this page. If you use this attribute, it must specify all ColdFusion AJAX tags that you use on the page and on any pages specified in tag source attributes. For a list of valid attribute values and their purposes, see Usage.Optional

Example

The following cfajaximport tag example specifies separate custom locations for the scripts used for AJAX features and for the AJAX CSS files. It also imports all JavaScript files used for cftree, and cftooltip.
<cfajaximport cssSrc="/collegeApp/application/cssFiles" 
    scriptsrc="/collegeApp/ajaxScripts" 
    tags="cftooltip, cfwindow">