Reputation: 229
I am trying create a tizen web app to set the wallpaper. After writing the code, I am getting internal error. There are no syntax erors. Kindly help. Here is the code
//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);
Upvotes: 0
Views: 112
Reputation: 1747
The reason you are getting this error is because may be the jquery which you are using is having version after 1.4.0 in which "pageinit" has been depricated. Instead you can use "pagecreate" event in place of "pageinit".
https://api.jquerymobile.com/pageinit/
Upvotes: 0