Simple information about userdata: Please click here
Once again, IE userdata is used in the project. Consider using the flash plug-in to store some chat records when the user does not use it
Trigger a bug? Conditions:
1. Store two attributes in the same xml file through userdata xxx.setAttribute('a', '111'); xxx.setAttribute('b', '222'); xxx. save('xmlname');
At this time, the xml file corresponding to userdata is like this
2. After refreshing the page with ctrl+F5, pass xxx.removeAttribute('a'); Remove known attribute 'a'; Expected result:
Actual result:
Bug? : When deleting one attribute, another attribute is also deleted
Guess: userdata may have some degree of binding association with IE's own cache during operation, and the cache is lost after a strong refresh lead to?
Solution:
When deleting an attribute, please first pass xxx.load('xmlname'); var val = xxx.getAttribute('b' ); Load another attribute and save it in a variable. After removeAttribute is successful, setAttribute('b', val); returns the b attribute.
Hope it helps, thank you.
ps: It’s great to use Storage, it’s awkward