Fix for IE7 and IE8

Restrict the scope of this so that IE can resolve the correct object.
Update the .replace() string to a non-breaking space wrapped in single quotes to resolve IE treating {/ /g} as {//g}.