Търсене в помощните статии

Избягвайте измамите при поддръжката. Никога няма да ви помолим да се обадите или изпратите SMS на телефонен номер или да споделите лична информация. Моля, докладвайте подозрителна активност на "Докладване за злоупотреба".

Научете повече

TypeError: 'key' called on an object that does not implement interface Storage

  • 2 отговора
  • 1 има този проблем
  • 1 изглед
  • Последен отговор от jkbjj

more options

Hi there,

The code below works fine on chrome, on Firefox I am getting the above error (TypeError: 'key' called on an object that does not implement interface Storage). Same bug described here: https://stackoverflow.com/questions/44176164/session-storage-error-on-firefox-only

//Code follows //-------------------------------------------------- $.ajax({ type: "POST", url: url, data: { Data: localStorage } }); //-------------------------------------------------- // Code end

Is this considered a bug? I really don't want to write different code for multiple browsers or adjusting it because of a bug....

Hi there, The code below works fine on chrome, on Firefox I am getting the above error (TypeError: 'key' called on an object that does not implement interface Storage). Same bug described here: https://stackoverflow.com/questions/44176164/session-storage-error-on-firefox-only //Code follows //-------------------------------------------------- $.ajax({ type: "POST", url: url, data: { Data: localStorage } }); //-------------------------------------------------- // Code end Is this considered a bug? I really don't want to write different code for multiple browsers or adjusting it because of a bug....

Всички отговори (2)

more options

Is this only a problem when jQuery is converting the object to key:value pairs, or is your script unable to access localStorage in other ways as well?

https://developer.mozilla.org/docs/Web/API/Storage

more options

FYI: JSON.parse(JSON.stringify(localStorage)) seems t have fixed the issue... athough I think this shouldn't be necessary