I want to set page backgroudImage using jQuery.
I wrote this code but it is not work.
What is the problem?
Image is exist

var Page = $(this);
$(function () {
SetBackgroundImage();
});
function SetBackgroundImage() {
//Todo read ImagePath from server
var ImageUrl;
ImageUrl ="../Images/BackgroudImage.jpg";
try {
Page.css('background-image', 'url(' + ImageUrl + ')');
} catch (e) {
//LogError
alert(e.Description);
}
}
The variable
Pagecurrently holds a reference to a jQuery object which is wrappend around thewindowelement. You’ll want the jQuery object to wrap around thebodytag.To retrieve the body element you’ll have to adjust your code a bit, like so:
I suggest you take a look at the jQuery API for some more information about jQuery.