Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Book for Integrating Javascript with Coldfusion????

Status
Not open for further replies.

ashw

MIS
Jun 10, 2002
61
0
0
CA
Can anyone recommend me a good book on integrating Javascript with coldfusion 5?
 
Haven't seen one for that specifically...

but what are you trying to do? Integrating ColdFusion with Javascript usually just boils down to including <CFOUTPUT>s and CF variables within <SCRIPT> tags... like:

Code:
<script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;>
function getCFTime(){

<CFOUTPUT>return &quot;#Now()#&quot;</CFOUTPUT>

}
</script>


any more &quot;integration&quot; really isn't possible, since ColdFusion processes server-side and javascript runs on the client... there's no way to have ColdFusion use javascript variables, for instance, since at the time CF processes the page the js variables contain no values (actually, they aren't even created yet... if you want to be picky).

If you want to share javascript values back to ColdFusion code, best that you can hope for is to write all the variables you want to share into form elements, then submit the form back to a .cfm page.

Thus... it'd be a pretty short book.

Hope it helps,
-Carl
 
Ditto...

If I may add, js can be looked at as syntactical sugar and basically makes your work much easier, user-friendly, efficient, and so forth.

If you tell us more, we can tell you more as well. Since your question was so broad, you are probably relatively new to both paradigms.

I look forward to your response...
 
i learned one thing when i was doing my dhtml scroller here:

I had to put the whole cf function all in a line with on carraige returns or nothing.. no whitespace. cf likes to generate whitespace, which will crash you javascript, as it did mine for some time.. couldn't figure out why till i looked at the output of the code... a half page of white.

so if you have trouble with it, pay attention to the output
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top