Doublons possibles:
Javascript toSource() method not working
Implementing Mozilla’s toSource() method in Internet Explorer.toSource dans Internet Explorer
Y at-il une autre méthode toSource pour Internet Explorer?
Doublons possibles:
Javascript toSource() method not working
Implementing Mozilla’s toSource() method in Internet Explorer.toSource dans Internet Explorer
Y at-il une autre méthode toSource pour Internet Explorer?
toSource
est non standard et fonctionne dans le moteur gecko seulement, donc ne fonctionnera pas en chrome, safari ou IE.
Voir this SO questions et réponses.
Il n'est pas la même chose que toSource()
mais json2.js a JSON.stringify()
qui convertit un objet JavaScript afin de JSON. Cela ne convertira pas tout ce qui sera .toSource()
. Il ne traite pas par exemple des fonctions.
Mieux dupliquer - [Implémentation de la méthode toSource() de Mozilla dans Internet Explorer] (http://stackoverflow.com/questions/171407/implementing-mozillas-tosource-method-in-internet-explorer) – gnarf