Fix to encode non-encoded URL in JavaScript code.