Posts tagged: javascript
How to strip <script> elements from HTML source – Prototype solution
stripScripts() -> string
Strips a string of anything that looks like an HTML script block.
Example:
1 2 | 'a <a href="#">link</a><script>alert("hello world!")</script>'.stripScripts(); // -> 'a <a href="#">link</a>' |
A href=”javascript: return false;” breaks in IE
Does not always work in IE. Workarounds:
1 | <a href="#" onClick="return false;"> |
OR
1 | <a href="javascript:;"> |
