Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 891

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
Preventing errors
The following rules and techniques help you prevent errors in your applications:
• To ensure that your code works properly, make sure that all your pages, including dynamically loaded content and
pages that contain dynamic regions, have valid
the page head. This is important for any page with ColdFusion Ajax tags and
script code is processed and that code is generated in the correct order. It also prevents problems in some browsers,
such as Internet Explorer.
• All JavaScript function definitions on pages that you include dynamically, for example by using a bind expression,
the
ColdFusion.navigate
following syntax format:
functionName = function(arguments) {function body}
Function definitions that use the following format might not work:
function functionName (arguments) {function body}
However, Adobe recommends that you include all custom JavaScript in external JavaScript files and import them
on the application's main page, and not write them in-line in code that you get dynamically. Imported pages do not
have this restriction on the function definition format.
• In a CFM page, if you call a JavaScript function present in a file that is bound to the page, ensure that you do not
use the keyword
while declaring the function.
var
cannot invoke the JavaScript function from the parent page.
• As a general rule, the
attributes or
id
unique on the page, including on any pages that you specify in
the following:
• You can use the same
about the selected button.
• You can use the same
information about all selected controls in the group.
• If you have multiple similar forms on a page, you might have controls in each form with the same name or ID.
You specify the individual controls in bind expressions by including the form name in the bind parameter.
• Do not use an Application.cfc
applications that use the
cfajaxproxy
features normally require that all returned data from the server must be in JSON format; the
method onRequestEnd.cfm page appends any output as non-JSON information to the end of the returned data.
• By default, all ColdFusion structure element names are in all uppercase characters. Therefore, your client-side Ajax
code, such as an
onSuccess
object's element names if you do not explicitly ensure that the element names are not all uppercase. (You can create
structure element names with lowercase characters by specifying the names in associative array notation, for
example,
myStruct["myElement"]="value"
• ColdFusion Ajax controls throw JavaScript errors if badly formed HTML causes errors in the browser DOM
hierarchy order. One example of such badly formed HTML is a table that contains a
contains table rows. In this situation, you place the table tag inside the
For browser-specific issues and other issues that could affect application appearance and behavior, see the ColdFusion
Release Notes on the Adobe website at www.adobe.com/go/learn_cfu_docs_en, and the ColdFusion Developer Center
on the Adobe website at www.adobe.com/go/prod_techarticles.
,
html
function, or a form submission within a ColdFusion Ajax container tag, must have the
var
attributes, when you do not specify
name
attribute for all options in a radio button group. Bind expressions get information
name
attribute for check boxes in a group if you want a single bind expression to get
name
function or onRequestEnd.cfm page that creates output in
onRequestEnd
tag or bind expressions that call CFC functions to get data. ColdFusion Ajax
function specified by a
cfajaxproxy
.)
Last updated 1/20/2012
, and
tags, and that all
head
body
script
declares a function-local scope variable. Therefore, you
id
attributes. Exceptions to this rule include
source
tag, must use uppercase letters for the returned
tag.
cfform
tags are located in
script
tags, where it ensures that the
attributes, of controls should be
onRequestEnd
tag, which in turn
cfform
886

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents