Visual Studio에서 다음 코드를 사용하고 있습니다. 바탕 화면 win10의 UWP 응용 프로그램이 내 Windows Phone에서 UWP 응용 프로그램으로 작동하지 않지만 완벽하게 작동합니다. 나는 또한 웹 서버에서 내 간단한 웹 응용 프로그램을 실행하고 가장자리에로드하려고 노력하고 완벽하게 작동합니다. 무엇이 문제인가? 내 코드는 다음과 같습니다. 에 MS-appx - 웹 라인 (28)에 처리되지 않은 예외, 열 25 : : 나는 SAIS 내 장치에서이 콘드을 RUND 때 지금정의되지 않은 또는 null 참조의 속성을 얻을 수 없습니다. UWP
var model = {
db: {},
goalsobj: {},
goals: [],
init: function() {
var openReq = window.indexedDB.open("GoalsDB");
openReq.onupgradeneeded = function (event) {
model.db = event.target.result;
var objectStore = model.db.createObjectStore("Goals", { keyPath: "id" });
objectStore.createIndex("id","id", {unique:true});
};
openReq.onsuccess = function (event) {
model.db = event.target.result
model.db.transaction("Goals", "readonly").objectStore("Goals").count().onsuccess = function (event) {
if (event.target.result == 0) {
console.log("indexeddb empty");
var goalstemplate = {
id: "idee",
goals: [{ "name": "Task1" }, { "name": "Task2" }, { "name": "Task3" }]
}
var addReq = model.db.transaction("Goals", "readwrite").objectStore("Goals").add(goalstemplate);
} else {
model.db.transaction("Goals", "readonly").objectStore("Goals").get("idee").onsuccess = function (e) {
model.goalsobj = e.target.result;
//console.log(e.target.result);
model.goals = model.goalsobj.goals;
goalfunc.makeList(); //model should not talk to view, but this case it is amust, because if I remove this, it does not render at boot.
}
}
}
openReq.onerror = function (event) {
console.log("Operation failed");
}
}
},
add: function(goalname) {
model.goals.push(
{
"name": goalname
});
model.savedb();
},
move: function (id,updown) {
if (updown == "up") {
model.goals.splice((id-1), 0, model.goals.splice(id, 1)[0]);
};
if (updown == "down") {
model.goals.splice((id+1), 0, model.goals.splice(id, 1)[0]);
};
},
savedb: function(){
//console.log(goals);
var update = model.db.transaction("Goals", "readwrite").objectStore("Goals").put(model.goalsobj);
update.onerror = function (event) {
console.log(event);
};
},
};
: 나는 일부를 생략 // 1318f74a-397e-4958-aa6b- c8d11b7c5dce/JS/main.js
0x800a138f - 자바 스크립트 런타임 오류 : 정의되지 않았거나 null 참조의 특성 '목표'를 가져올 수 없습니다
감사합니다! 나는 다른 장치를 얻을 수 있었고 잘 작동합니다. – Peter