script tag code hide after save template

Deepak Panda, modified 6 Years ago. New Member Posts: 18 Join Date: 4/19/19 Recent Posts
Hi,

I have one issue in my server, where I am creating a web content template and write <script>...............</script> after Freemarker coding.
But after successfully save this template, code within <script> is hide. Kindly help, why this happened. 
thumbnail
Olaf Kock, modified 6 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
Deepak Panda

I have one issue in my server, where I am creating a web content template and write <script>...............</script> after Freemarker coding.
But after successfully save this template, code within <script> is hide. Kindly help, why this happened. 
Works for me. DXP 7.1 SP1, created a Template for Basic Web Content like this:
${content.getData()}
<script>alert('test');</script>
And it works as expected: Nags me every time I load the page, and survives template edits.
thumbnail
Christoph Rabel, modified 6 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
It's the javascript minifier. It drops script tags in several Liferay versions.
Try "<script type="text/javascript">", then it should work it in most Liferay version.