So would eval(js_strting).
So I could pass this back from my ajax call
var test = 0;
function Testing()
{
Test++;
}
And then eval(string) and call Testing()
That's why I love dojo, this is all built in for me:-)
Andrew Scott
Senior Coldfusion Developer
Aegeon Pty. Ltd.
www.aegeon.com.au
Phone: +613 8676 4223
Mobile: 0404 998 273
-----Original Message-----
From: Brad Wood [mailto:[EMAIL PROTECTED]
Sent: Thursday, 8 February 2007 11:38 AM
To: CF-Talk
Subject: RE: Dynamic JS
Yeah, the function which uses regex to pull out any script blocks and
eval() them seems pretty straight forward. I had thought doing that in
CF before I returned the HTML, and then returning the js as a separate
string and evaling it there. Same difference I guess.
The only thing I am worried about is this sentence:
"However if the JavaScript sent by the server contains functions, these
functions will not be accessible from any others scripts once the eval
function is over."
I wonder if changing
function test() {alert('Hello World!');}
To
window.test = function(){alert('Hello World!');}
Would work.
~Brad
-----Original Message-----
From: Josh Nathanson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 07, 2007 6:29 PM
To: CF-Talk
Subject: Re: Dynamic JS
Actually looking at that article again, it doesn't look that tough...you
would just need to add a couple of functions into your ajax scripts and
away
you go. There are some limitations but they might not apply to your
situation. The other possible "gotcha" would be cross-browser
compatibility.
-- Josh
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:269103
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4