0

我正在尝试创建一个 tizen 网络应用程序来设置壁纸。编写代码后,我收到内部错误。没有语法错误。请帮忙。这是代码

//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);

4

1 回答 1

0

您收到此错误的原因可能是您使用的 jquery 具有 1.4.0 之后的版本,其中“pageinit”已被贬低。相反,您可以使用“pagecreate”事件代替“pageinit”。

https://api.jquerymobile.com/pageinit/

于 2015-05-31T12:43:59.520 回答