我正在尝试创建一个tizen web应用程序来设置墙纸。在写完代码后,我得到了内部错误。没有语法错误。请帮帮忙。以下是代码
//Initialize function
function setWallpaperSuccess(){
console.log("Wallpaper successfully set");
}
function setWallPaperError(error){
console.log("Failed to set wallpaper: " + error.message)
}
var init = function () {
$('div[data-role="page"]:first .ui-btn-back').bind("click", function(event) {
var currentApp = tizen.application.getCurrentApplication();
currentApp.exit();
});
// TODO:: Do your initialization job
console.log("init() called");
$( "#btnSetWallpaper" ).bind( "click", function(event, ui) {
try{
tizen.systemsetting.setProperty("LOCK_SCREEN", "SampleProject/images/image0.jpg", setWallpaperSuccess, setWallPaperError);
tizen.systemsetting.setProperty("HOME_SCREEN", "SampleProject/images/image0.jpg", setWallpaperSuccess, setWallPaperError);
}
catch (error){
console.log("Set wallpaper invokes exception: " + error.message);
}
});
};
$(document).bind('pageinit', init);
发布于 2015-05-31 20:44:00
出现此错误的原因可能是因为您使用的jquery的版本高于1.4.0,其中"pageinit“已被删除。相反,您可以使用"pagecreate“事件代替"pageinit”。
https://stackoverflow.com/questions/30064263
复制相似问题