phpBB3 BBCode Help
Posted: Tue Nov 17, 2009 3:33 pm
I'm currently writing some custom BBCode for my site. Everything below works fine except for one thing - the single quote never gets replaced! I've tried multiple methods, from using .indexOf to remove it from the statement to the replace below. No matter what I do, it still gets through. I know it's not Javascript error, as I have a compiler and I've debugged it several times to find it working client-side.
BBCode:
Replace Code:
BBCode:
Code: Select all
[mmoitem]{TEXT}[/mmoitem]Code: Select all
<script type="text/javascript">
var myOldString = "{TEXT}";
var myNewString = myOldString.replace(/ /g, "-");
var myNewString = myNewString.replace(/'/g, "");
var lnk = "<a href=http://mmo-champion.com target='_blank' title='mmo-champion.com'><img src='http://www.mmo-champion.com/favicon.ico'></a><a href=http://db.mmo-champion.com/i/" + myNewString + " target='_blank'>" + myOldString + "</a>";
document.write(lnk);
</script>