Contact Us

Let us know to help you out quickly!

 Bharat Patel     Feb,08 2017

HTML and Javascript in CFSCRIPT Tag

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.

<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>