PDA

View Full Version : Removing comment tags



vinnie
Sep 29th, 2009, 04:53 AM
I want to strip out specific comment tags from html code that is dynamically generated -

I want to add some javascript to remove the comment tags - The comment tags are always the same and do not change -

ie;

<!--my comment tags-->

Any help would be appreciated to strip these tags from the end user source code

Thanks

abduraooft
Sep 29th, 2009, 10:40 AM
Any help would be appreciated to strip these tags from the end user source code You can't remove anything from the source code using javascript, unless it's added by javascript. You'd need to use a "search and replace from all files" using an editor like DW,notepad++ or parse the document by some serverside code and remove that comments before sending to browser.

Javascript is just a client side language and people can even block it from their browser

Rowsdower!
Sep 29th, 2009, 03:43 PM
If you have access to the dynamic content you can always change the server-side script that is generating the comments and remove it at the source. Why exactly do you need to do this?