Chapter17.Using JavaScript and ColdFusion Together


Chapter 17. Using JavaScript and ColdFusion Together

IN THIS CHAPTER

A Crash Course in JavaScript 455

Working with Form Elements 466

Passing Variables to JavaScript 468

Passing Data to JavaScript Using <cfwddx> 488

Working with WDDX Packets in JavaScript 500

Calling CFCs from JavaScript 517

Passing Simple Variables to ColdFusion 519

As you now know, ColdFusion gives you an extremely powerful, easy to use language for creating interactive Web sites. As you also know, all ColdFusion code executes on the server; the browser isn't expected to understand CFML, and it certainly isn't expected to be able to connect to your databases and other server-side resources directly.

All of which is, like, sooooo dreamy. But depending on the application, you may sometimes need to exert some kind of programmatic control over the browser itselfits windows, status bars, form fields, and so on. This is where JavaScript comes in. Rather than executing on the server, JavaScript code executes on the client machine, within the context of the browser.

There is often a bit of disconnect between the worlds of ColdFusion and JavaScript developers. ColdFusion developers often don't know much about JavaScript, and vice-versa. As such, ColdFusion developers tend to solve problems from the server side, while JavaScript folks solve problems on the client; either approach can be more elegant or appropriate, depending on the situation. It's easy to see that knowing something about both is the best thing, so that you at least know what your options are.

The intent of this chapter is to familiarize you with JavaScript and the role it can play in ColdFusion applications. In particular, it focuses on making forms more interactive and lively, and passing or sharing variables between the two environments. You will also learn how to use WDDX with JavaScript.



Advanced Macromedia ColdFusion MX 7 Application Development
Advanced Macromedia ColdFusion MX 7 Application Development
ISBN: 0321292693
EAN: 2147483647
Year: 2006
Pages: 240
Authors: Ben Forta, et al

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net