I want to load an entire website in to my website. I have been able to do this with $(#preview).load("index.php") into my <div id="preview"></div>. What i have troubles accessing here is the background image which is a property of body. I tried making a div tag with a background-image attribute but when i removed the image from my body tag it didnt behave like i wanted to (was not filling the entire space).
My question is this. How can i access something from index.php that can let me either preview the site correctly or copy the attribute from somewhere into the preview background-image attribute?
my code now looks like this, after some extensive try-and-error (more like error-and-error and its getting more and more messy)
$(document).ready(
function() {
$("#check").click(
function() {
var bgd;
$("#preview").load("index.php",
function () {
bgd = $("#bg").css("background-image");
}
);
$("#preview").style.backgroundImage(bgd);
}
);
}
);
Where bg is the id of the div which works as a "substitute" body tag in index.php (aka with the same attributes as body)
Im either far from it, or ridiculously close. Thanks for every piece of advice i can get.
styleandbackgroundImageis not a jQuery method.. you should try.css('background-image',bgd)