-1
我options.html:
<!doctype html>
<html>
<head>
<title>Item Notifier v1.0.2</title>
<link href="style.css" rel="stylesheet" type="text/css">
<script src="jquery.js"></script>
<script src="options.js"></script>
</head>
<body>
<h1>Cowboy's Item Notifyer</h1>
<label>Last updated hat:<h2 id='itemname'>[ loading... ]</h2></label>
</body>
</html>
然後我options.js:
$(document).ready(function() {
$('#itemname').html() = localStorage.mostRecentHat;
});
它應該的innerHTML從[ loading... ]
改變值爲mostRecentHat
,但它變成未定義的值,並且不會更改innerHTML。