Steve

<cfajaximport scriptsrc="..."> is only for cf's built-in scripts - you 
do not use it to load anything else. and you only need to use it if you 
do not have access to default cf's scripts folder or if you have moved 
the default cf scripts to another folder.

to load jquery or any other js scripts, you just use your regular 
<script> tags in the <head> section of your page.

specifically for dealing with scripts in pages loaded into cf's ajax 
containers i found this approach working best:

- include your js library (jquery) in the main page (the one that has 
cflayout tags in you case)
- include any js code that needs to run after pages have been loaded 
into ajax containers as separate js functions in the main page's <head> 
section as well.
- in the pages loaded inside ajax containers add <cfset 
ajaxonload('name-of-your-js-function-to-execute-here')> as the last line 
before the closing </body> tag: this will run the specified js function 
after the page has been loaded inside the container

Azadi

On 11/04/2011 22:31 , Steve Sequenzia wrote:
> Andrew,
>
> I understand what you are saying. I would rather import the files. I just 
> can't seem to get the syntax right. I am trying this -<cfajaximport 
> scriptsrc="\CFIDE\scripts\jquery\">
>
> When I do that all the other ajax stuff on the page does not load. Do I need 
> to redirect all the files?
>
> Thanks again.
>
> -Steve
>
> > From my experience it is always that people forget that these new UI
>> features, all created div and other elements in the current page to do what
>> they need.
>>
>> Ok having said that, I am betting my bottom dollar that with what you are
>> returning to be displayed, doesn't contain any<html><body>  etc html tags.
>> This is important because the ColdFusion underneath the hood, needs these
>> tags to include the extra files etc that they need. And because the main
>> page is already loaded, ColdFusion can't add them to the current page, from
>> the page that is being loaded.
>>
>> I hope that makes sense, there are two options you can try here and option 2
>> is my preferred method.
>>
>> Option 1: return the html tags<html><body>  etc, this would ensure that the
>> import the tag on the page, ColdFusion while generating the page can place
>> the needed code in the header of the page. Downside to this is that you end
>> up with a malformed dom, and will fail validators.
>>
>> Option 2: Just place the import on the main page, this might seem overkill
>> if you are only going to use it once or twice. But the upside is that you
>> are generating valid html.
>>
>>
>> Regards,
>> Andrew Scott
>> http://www.andyscott.id.au/
>>
>>
>>> Andrew,
>>>
>>> Thanks for the response.
>>>
>>> I fixed the functions to this format - funcName = function() {};. All of
>> the
>>> scripts are in separate files. Do I need to use cfajaximport scriptSrc or
>> can I
>>> just put the scripts into the CFIDE/scripts folder? I am confused how all
>> that
>>> works.
>>>
>>> Thanks again.
>>>
>>> -Steve
>>>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343650
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to