problem about doing it online , it works fine in localhost
i have this code its prints the specific div by div id
function printDiv(divID) {
//Get the HTML of div
var divElements = document.getElementById(divID).innerHTML;
//Get the HTML of whole page
var oldPage = document.body.innerHTML;
//Reset the page's HTML with div's HTML only
document.body.innerHTML ="<html><head><title> </title></head><body>"+divElements + "</body>";
//Print Page
window.print();
//Restore orignal HTML
document.body.innerHTML = oldPage;
}
it works beautiful in my localhost
but when i upload the file to my onlinehost it show like this picture
can someone help me what is the error ?