我想將圖像追加到本地存儲。如何將圖像追加到本地存儲?
我有一個div,我想保存所有這些圖像。事情就這麼簡單:
<div id="imageContainer">
<!--have images go here-->
</div>
我試圖做到的是這樣的:
if (Math.floor((Math.random()*3)+1) == 1) { // 1/3 chance of conditional being true
// append some image to #imageContainer and have it locally stored
} else {
alert('no luck this time...');
}
因此,每個上面條件爲真,我將如何添加圖像到#imageContainer
有時間它在本地保存?
谷歌我的兒子:http://diveintohtml5.info/storage.html – 2012-08-03 17:53:30
你想存儲src? – NicoSantangelo 2012-08-03 17:54:30
我想在#imageContainer – Jon 2012-08-03 19:22:00