Overriding embedit.in script to allow downloads of PDF
I'm a library and information science student and a true programming novice (I've only taken one introductory course in JS, PHP, and MySQL), so I would really love some help. I'm sorry that I might not have the right vocabulary to talk about this!
I am building a prototype of a digital thesis collection for a course, and I am using the embedit.in sitewide script so that users can view the PDFs linked to in each thesis record in an overlay viewer. The problem is that the overlay viewer does not give the user the option to download the PDF (although that is an advertised feature, there actually is no download button in the viewer for some reason), and the script works for the whole page, so I cannot provide an alternate link to the PDF that would allow users to download directly. I also can't see the script itself so I don't know exactly what it's doing. I really like the overlay viewer, but I want users to be able to download the PDFs as well. Ideally, I envision having two side-by-side links, one that says "Click here to view or print," which allows users to launch the viewer, and the other that says, "Click here to download," that does not launch the viewer and lets them download it. Is there anyway to write a script that would prevent the embedit.in script from working against a specific link on the page, without seeing the script itself?
Here is a bit of the HTML code from a sample thesis record page below, for a bit of context:
<h2>Development of the Black Community of Bedford-Stuyvesant</h2>
<div id="description">
<p><strong>Title:</strong> Development of the Black Community 开发者_如何学JAVAof Bedford-Stuyvesant<br />
<strong>Author:</strong> Austin Finigan, Jr.<br />
<strong>Date:</strong> 1974<br />
<strong>Subjects:</strong> African Americans--New York (State)--New York<br />
Brooklyn (New York, N.Y.)--History<br />
<br />
<a href="finigan.pdf">Click here to view or print PDF</a></div>
<script src="http://embedit.in/sitewide.054fbf300b0637d7d8cc525ff36789500da4f3c2.js" type="text/javascript"></script>
I just created two links and put them side-by-side, one that links to the PDF directly and opens the overlay viewer via the embedit.in sitewide script and the other that links to a new blank page with a redirect script to the PDF so that the browser's download dialog box launches when the page opens. I hate the blank page but it works.
精彩评论