My note: Use
encodeURIComponent() if is supported. Otherwise use escape instead of "not doing anything".I recommend that you add such a utility function in your utility .js file:
function urlEncode(string) {
if (window.encodeURIComponent) {
return encodeURIComponent(string);
}
// if encodeURIComponent is not supported, use escape
return escape(string);
}
Hiç yorum yok:
Yorum Gönder