HaDe HaDe - 2 months ago 7
Javascript Question

how to reload page after take printout using jquery?

below function used for take printout of a div but reloading of page is not working properly after printing(links and jquery ui tabs are not working)

function PrintDiv(id) {
var divElements = document.getElementById(id).innerHTML;
var oldPage = document.body.innerHTML;
document.body.innerHTML =
"<html><head><title></title></head><body>" +
divElements + "</body>";
window.print();
document.body.innerHTML = oldPage;


}

Answer

use this code:

location.reload()
Comments