Home:ALL Converter>remove java script from html using sed

remove java script from html using sed

Ask Time:2015-11-08T21:42:48         Author:user3716621

Json Formatter

I am trying to remove java script tags for google_ad_client from php/html files using find , sed but it doesn't work

For example, if the script tags contain something like this:

<script type="text/javascript"><!--
google_ad_client = "ca-pub-7800000000";
/* my_navbar */
google_ad_slot = "4996537872";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>

so i use the following command to remove it

find . -type f -name '*.php*' -print0 | xargs sed -i '/<script type="text\/javascript">/,/<\/script>/g'

this work but it delete me all java script in side my html files

Author:user3716621,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/33594602/remove-java-script-from-html-using-sed
yy