How do I load the background image from another page?
- by bbeckford
Hi all,
I'm creating a page that loads content from other pages using jQuery like this:
$('#newPage').load('example.html' + ' #pageContent', function() {
loadComplete();
});
That all works fine.
Now what I want to do is change the background image of the current page to the background image of the page I'm loading from.
This is what I'm doing now but I can't for the life of me get it to work:
$.get('example.html', function(data) {
var pageHTML = $(data);
var pageBody = pageHTML.$('body');
alert(pageBody.attr("background"));
});
What am I doing wrong??
Thanks,
-Ben