Home > Web Front-end > JS Tutorial > A bug description of IE's local storage of userdata_javascript skills

A bug description of IE's local storage of userdata_javascript skills

WBOY
Release: 2016-05-16 18:24:03
Original
860 people have browsed it

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

Related labels:
bug
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template