|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
need function available for ColdFusion and JS
Author: daniel kessler
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:33026#165732
No, I don't want to write out a js function, just call one that's already there.
But that's ok. I'll just use a different implementation. I thought of it as a
solution and tried to determine how practical it was, which it wasn't. Shame
though, it's nice, easy gui to put up an alert.
----- Excess quoted text cut - see Original Post for more -----
> _____
Author: Dave Watts
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:33026#165694
> And can I guess that the server-side CF, won't call a
> client-side JS function?
That's correct.
> I guess I can validate this form in CF, but I'd still like
> to have the JS alerts rather than go to another page, just
> to say "hey fill in the header, guy!".
It sounds to me like you want to have JavaScript form validation for
user-friendliness and convenience, and server-side form validation for
security and robustness.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444
Author: Whittingham, P
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:33026#165692
do you mean this.
Pat
<cfoutput>
function new_fnc() {
......more javascript code
.
...
....
alert('#cf_variable#');
return true;
} // end of new_fnc.....
</cfoutput>
>You can't use a CF function in JS. Different syntax!!!! You have to
>duplicate it (and adapt it to JS).
that's not exactly what I meant. I meant to call the js function from cf, but
others have told me that this isn't doable or practicle. Really I just
wanted the js alerts.
Still, duplicating the cf function in js is almost a drop'n'play. Since it's
written in an ecma like script, all I really need to do is to change the EQ to
== (and such) and adjust the names of any api calls - createDateTime() becomes
Date().
thanks for answering Pascal, Dave and everyone.
_____
Author: daniel kessler
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:33026#165689
>You can't use a CF function in JS. Different syntax!!!! You have to
>duplicate it (and adapt it to JS).
that's not exactly what I meant. I meant to call the js function from cf, but
others have told me that this isn't doable or practicle. Really I just wanted
the js alerts.
Still, duplicating the cf function in js is almost a drop'n'play. Since it's
written in an ecma like script, all I really need to do is to change the EQ to ==
(and such) and adjust the names of any api calls - createDateTime() becomes
Date().
thanks for answering Pascal, Dave and
everyone.
Author: Pascal Peters
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:33026#165674
You can't use a CF function in JS. Different syntax!!!! You have to
duplicate it (and adapt it to JS).
Pascal
----- Excess quoted text cut - see Original Post for more -----
Author: Guy Rish
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:33026#165673
Daniel,
You will need to duplicate the functionality. CFML functions only execute
on the server - building the page. JavaScript functions run in the browser
once the page is built and sent to the client.
Now depending upon your needs you can use CFML to build your JS function...
rish
I have a cold fusion function that is used by other CF functions.
I've found that a JS function now needs it. Should I just duplicate
it for JS or can it use the CF function? I'd hate to dup it cause
it's the only place where a js function needs it.
thanks.
--
Daniel Kessler
Department of Public and Community Health
University of Maryland
Suite 2387 Valley Drive
College Park, MD 20742-2611
301-405-2545 Phone
www.phi.umd.edu
Author: daniel kessler
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:33026#165667
>Client-side JavaScript run within a browser cannot directly invoke a
>function written in CF.
ah that makes total sense, said that way : )
And can I guess that the server-side CF, won't call a client-side JS function? I
guess I can validate this form in CF, but I'd still like to have the JS alerts
rather than go to another page, just to say "hey fill in the header,
guy!".
Author: Dave Watts
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:33026#165665
> I have a cold fusion function that is used by other CF
> functions. I've found that a JS function now needs it.
> Should I just duplicate it for JS or can it use the CF
> function? I'd hate to dup it cause it's the only place
> where a js function needs it.
Client-side JavaScript run within a browser cannot directly invoke a
function written in CF.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444
Author: Daniel Kessler
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:33026#165662
I have a cold fusion function that is used by other CF functions.
I've found that a JS function now needs it. Should I just duplicate
it for JS or can it use the CF function? I'd hate to dup it cause
it's the only place where a js function needs it.
thanks.
--
Daniel Kessler
Department of Public and Community Health
University of Maryland
Suite 2387 Valley Drive
College Park, MD 20742-2611
301-405-2545 Phone
www.phi.umd.edu
|
May 24, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||