I found a bit of code on the web that I would like to use.
$(document).ready(function() {
$(".fbreplace").html.replace(/<!-- FBML /g, "");
$(".fbreplace").html.replace(/ -->/g, "");
$(".fbreplace").style.display = "block";
});
The problem is the browser thinks
<!--
is a real comment. How would I quote it in a way to tell the browser look for that string and it is not a real comment?
Escaping one of the symbols won't change the regular expression. You can use a backslash to prevent the browser from interpreting the --
as the start or end of an HTML comment:
/<!-\- FBML /g
Having said that, I don't know of any modern browser that would misinterpret a piece of Javascript as a comment if the Javascript is correctly enclosed in a <script>
tag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With