데이터 저장소로 WebSQL을 사용하는 작은 응용 프로그램이 있습니다.
이 데이터를 웹 서버 (PHP + MySQL)와 동기화하고 싶습니다.
WebSQL에서 JSON을 어떻게 전송할 수 있는지 잘 모르는 주된 문제점은 무엇입니까?JSON fton WebSQL을 얻는 방법
//view the result from DB on a web-page
$('body').html('<ul id="dataAllHere"></ul>')
mybase.init.getAll = function(){
var database = mybase.init.db;
database.transaction(function(tx){
tx.executeSql("SELECT * FROM table", [], function(tx,result){
for (var i=0; i < result.rows.length; i++) {
item = result.rows.item(i).item;
due_date = result.rows.item(i).due_date;
the_type = result.rows.item(i).the_type;
id = result.rows.item(i).ID;
showAll(item,due_date, the_type, id);
}
});
});
}
function showAll(item,due_date, the_type, id){
$('#dataAllHere').append('<li>'+item+' '+due_date+' '+the_type+' '+id+'</li>');
}
mybase.init.getAll();
저는 JSON에 익숙하지 않아 도움이나 조언을 듣게되어 기쁩니다.
감사합니다.
TYWM! 이상하지만, myJson이 정의되지 않았 음을 알려줍니다. –