- February 8, 2017
- Posted by: Bharat Patel
- Category: Uncategorized
No Comments
In coldfusion programming we need to use javascript any time. We can easily do this. We can not write directly javascript in CFSCRIPT tag. There is one way to write javascript in CFSCRIPT tag. Look below code. I hope you may find it interesting.
[code:cf]
<cfscript>
WriteOutput(‘
<script language="JavaScript">
str = confirm("Do you like the cfscript tag?");
if (str == true)
alert("Yes, I like it.");
else if (str == false)
alert("No, I do not like.");
</script>
‘);
</cfscript>
<cfscript>
WriteOutput(‘
<h1>Html using cfscript</h1>
‘);
</cfscript>
[/code]