Using replace to fix issue with jQuery and closure compiler