0
我下載了「TempHire」示例並使用IE 10(Windows 8)運行。在breeze.debug.js
出現了一個錯誤:Breeze 1.3.5 localStorage「系統找不到指定的路徑」
Unhandled exception at line 13707, column 13 in http://localhost:49795/scripts/breeze.debug.js
0x80070003 - JavaScript runtime error: The system cannot find the path specified.
錯誤的部分:
if (typeof (localStorage) != 'undefined') {
var mongoMachineId = parseInt(localStorage['mongoMachineId']); //The error appeared here
if (mongoMachineId >= 0 && mongoMachineId <= 16777215) {
machine = Math.floor(localStorage['mongoMachineId']);
}
// Just always stick the value in.
localStorage['mongoMachineId'] = machine;
document.cookie = 'mongoMachineId=' + machine + ';expires=Tue, 19 Jan 2038 05:00:00 GMT';
}
問題是typeof (localStorage) != 'undefined'
是true
因爲typeof (localStorage)
等於'unknown'
當異常 「The system cannot find the path specified.
」 出現了。
我不知道如何完全重現這個錯誤,因爲可能它是localStorage的隨機錯誤。
我已經刪除了所有的瀏覽器歷史記錄,所有工作都很好,但後來IE10,Google Chrome 27和Firefox21的錯誤仍然存在。
請任何幫助,將不勝感激。