

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can I remove the (//<![CDATA[ , //]]>) blocks; tags inside a script element in Javascript?
To remove the block inside a <script> element, use the [\s\S]*?:
<script> /* <![CDATA[ */ var A=new Array(); /* ]]> */ </script> Demo Text Demo Text Demo Text <script type="text/javascript"> /* <![CDATA[ */ var B=new Array(); Demo Text Demo Text /* ]]> */ </script> Demo Text
- Related Questions & Answers
- Are HTML comments inside script tags a best practice?
- Should I include language="javascript" in my SCRIPT tags?
- Should I include type=“text/javascript” in my SCRIPT tags?
- How can I remove the same element in the list by Python
- How to remove html tags from a string in JavaScript?
- How can I remove everything inside of a <div> using jQuery?
- Where should I put <script> tags in HTML markup?
- How can I remove the decimal part of JavaScript number?
- How can I remove a child node in HTML using JavaScript?
- How do I remove a particular element from an array in JavaScript
- How to get content of div which contains JavaScript script blocks?
- How can I remove a specific item from an array JavaScript?
- How can I remove a specific item from an array in JavaScript
- An element inside another element in JavaScript?
- Remove any text not inside element tag on a web page with JavaScript?
Advertisements