What problems can cause using obsolete javascript functions?


I have the following question, is it a problem to use obsolete javascript functions?

As for example using the functions "escape" and "unescape" instead of "encodeURI" and "decodeURI".


asked by M. Giner 07.03.2018 в 09:37

2 answers


Usually when a function in any API is considered obsolete, we should avoid it because:

  • There are compelling reasons why its creators (or maintainers) have marked it as obsolete: incorrect or unintuitive functionality, failure in the design itself that can not be solved without breaking retro-compatibility, very low performance .. .
  • Depends on each case, but it is possible that the functionality disappears as it is your substitute accepted by users.

The escape () function was divided into two because there were two possible scenarios: a URI or a component of a URI. In each case you have to treat the chain differently to avoid problems, which you can not do with a single function.

answered by 07.03.2018 / 10:33

The problem is that, although browsers still support them, at any time they can stop supporting them because they no longer belong to the standard.

So, although now it will work without problems in any browser, it is very likely that in the near future some of them (or all) will stop supporting it.

answered by 07.03.2018 в 10:23