我已經創建了一個簡單的html頁面來測試localstorage和我的生活我無法得到它的工作,即使我的螢火蟲顯示localstorage存儲值作爲我在這裏存儲的是我的第一代碼所謂Testhtml.html html頁面爲什麼我的HTML 5本地存儲不起作用?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>TEsthtml.html</title>
</head>
<script >
function save()
{
var passvalue = document.getElementById('entry_1').value;
localStorage.setItem('passingvalue', passvalue);
}
</script>
<body>
<form action="simple.html" method="POST">
<label for="entry_0">Type ur name</label>
<input type="text" name="entry.0.single" value="" id="entry_0">
<br>
<label for="entry_1">ur pets name
</label>
<label for="entry_1">type something</label>
<input type="text" name="entry.1.single" value="" id="entry_1">
<br>
<input type="submit" name="submit" id="submit" onClick="save()" value="Submit">
</form>
</body>
</html>
第二種形式叫simple.html代碼如下
我嘗試運行這段代碼simple.html這是第二種形式在唯一的文本框中那裏沒有顯示任何東西..嘗試了很多不同的東西!
哇,這是foobar !! ...非常好,它的工作只是好人tks! – JackyBoi 2011-12-24 01:22:48