JavaScript Sometime footer show and show time not show wkhtmltopdf

I m trying to add page number in footer this is my code

var pdfInfo = {};
var x = document.location.search.substring(1).split('&');
for (var i in x)
{
    var z = x[i].split('=',2);
    pdfInfo[z[0]] = unescape(z[1]);
}
function getPdfInfo() {
    var page = pdfInfo.page || 1;
    var pageCount = pdfInfo.topage || 1;
    document.getElementById('page').innerText = page;
    document.getElementById('topage').innerText = pageCount;
}

i m calling this js function on body load

<body onload="getPdfInfo()">
<div style="text-align:right; font-family: tahoma !important; font-size: 12px !important;">
     Page
     <span id="page" class="page"></span>
     of
     <span id="topage" class="topage"></span>
 </div>
</body>

but some time footer show and some time not show and some time footer show on first page and not show on second page

Answer:1

I'm working on an Office Add-in (formerly Apps for office) using office.js library. My app adds a handler to get notified about data changes in excel sheet: Microsoft.Office.WebExtension.select("...

I'm working on an Office Add-in (formerly Apps for office) using office.js library. My app adds a handler to get notified about data changes in excel sheet: Microsoft.Office.WebExtension.select("...

I'm using Nprogress to show a loading state for ajax requests on my Rails app. I've accomplished to make it work with all normal ajax calls but I'm now having problems with rails remote forms. I'm ...

I'm using Nprogress to show a loading state for ajax requests on my Rails app. I've accomplished to make it work with all normal ajax calls but I'm now having problems with rails remote forms. I'm ...

In my web site I need to pop up a dummy 'loading' spinning wheel when click a button and vanish after some time. It's just a dummy page. I would be much obliged if anyone can explain how to do such a ...

In my web site I need to pop up a dummy 'loading' spinning wheel when click a button and vanish after some time. It's just a dummy page. I would be much obliged if anyone can explain how to do such a ...

$(document).ready(function(){ var links = $('body').find('a.internal'); links.on('click', function(e){ //pull page with ajax and replace the content with this response //...

$(document).ready(function(){ var links = $('body').find('a.internal'); links.on('click', function(e){ //pull page with ajax and replace the content with this response //...

  1. jquery reset variable
  2. jquery setting width
  3. jquery setting value
  4. reset recaptcha jquery
  5. resetting in jquery
  6. resetting form in jquery
  7. resetting dropdown in jquery
  8. reset form using jquery
  9. resetting textbox in jquery