Use jQuery to escape instead of a homebrew replace function.