Connecting Tech Pros Worldwide Help | Site Map

How can I include all the scripts in a folder?

Haitashi's Avatar
Member
 
Join Date: Jun 2007
Location: Orlando, FL
Posts: 94
#1: Mar 12 '08
I've been using CFAJAXIMPORT to import all the scripts from CFIDE (which doesn't live in the site's root directory for recurity reasons). I need to include this folder to get things like CFWINDOW to work properly. I'm attaching how I've been trying to import all the scripts but I get an error when I use CFAJAXIMPORT. It says "Invalid usage of AJAX tag" "Use cfajaximport tag to specify SCRIPTSRC or make sure all ajax controls are inside a single cfform tag that has SCRIPTSRC". The leads me to think that CFAJAXIMPORT is not the correct way to load all the scripts from a specified directory. This how I call that CFAJAXIMPORT tag:
Expand|Select|Wrap|Line Numbers
  1. <cfajaximport scriptSrc="jslib/cfidescripts/cf8" />
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#2: Mar 12 '08

re: How can I include all the scripts in a folder?


Are you using scriptSrc somewhere else within the same page, e.g. cfform? This may be the cause of the error.
Haitashi's Avatar
Member
 
Join Date: Jun 2007
Location: Orlando, FL
Posts: 94
#3: Mar 12 '08

re: How can I include all the scripts in a folder?


I figured out why. It wasn't being included somewhere else but cfajaximport tag must precede all other ColdFusion AJAX tags on the page*; that is, all tags that rely on the scripts.

Since we are using a framework, I'm pretty sure that requirement is not being met properly.

What I did was that I changed the default script directory from the CF management to point to this directory.
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#4: Mar 12 '08

re: How can I include all the scripts in a folder?


Glad you got it working.
Reply