>> the only way i can make it actually display an alert within
>> javascript is if i do the following code:
>>
>> alert("<cfoutput>#student.name#</cfoutput>");
>>
>> if i do the following it doesnt work:
>>
>> alert(#student.name#);
>>
>> am i doing something wrong
First, in order to get the second example to work, you'd still need to wrap
the #student.name# with quotes. Otherwise the output would be interpreted as
JavaScript instructions.
Second, you'll also want to wrap your output in the jsStringFormat()
function:
<cfoutput>
alert("#jsStringFormat(student.name)#");
</cfoutput>
This will make sure you don't get JS errors if your output contains quotes,
carriage returns and other characters that could break the JavaScript
string.
-Dan
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:254070
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4