Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
XML
i am using the object tag to load the pdf...

i have been using onreadystatechanged to remove the loading spinner. its working fine for IE and Firefox but in Chrome and safari the loading spinner does not stop..it keeps spinning

this is my object tag code

<object class="boxfull" type="application/pdf" onreadystatechange="return hideloading();" data="@Url.Action("ReportPDF", new { ReadingID = ViewBag.ReadingID})">
<object>

hideloading() is a function which contains

    function hideloading(a) {
        $("#loading-overlay, #loading").hide();
        return false;
    }

i am hiding the loading spinner and overlay..

But its not solved for Chrome and Safari.. i think its not taking the event of onreadystatechange.

Plz help
Posted

onreadystatechanged is not supported in chrome.
 
Share this answer
 
Comments
Swapnil Bidkar 1-Apr-15 4:23am    
yes right onreadystatechanged is not supported in Chrome..So is there any event which is supported by all the browser. . or is there any another way than using <object> tag which will be supported on all browser
Richard Deeming 18-Aug-15 11:04am    
See if PDF.js[^] does what you need. It's the same tool that Firefox uses to display PDF files in the browser.
In the latest browser versions, object tag no longer supports application/pdf type.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900