let css_pdf_zero = ['cssFoundations.pdf', 'cssCookBook.pdf'];
function pdf_load_zero(pdf, path){
path = path || 'pdf-testing/'; // default path here
var pdfAnchor = '<a href="' + path + '" alt = "">' + '</a>';
document.write(pdfAnchor); document.close();
}
$('#tabs-one1').html(pdf_load_zero(css_pdf_zero));
Asked
Active
Viewed 16 times
0

Siyad Nijah
- 55
- 7
-
What are you trying to accomplish with document.write? – Dennis Kiesel Aug 08 '17 at 04:45
-
Yeah that's just a mistake but even still it doesn't work if you remove it – Siyad Nijah Aug 08 '17 at 04:54
1 Answers
0
Is this closer to what you are trying to do?
let css_pdf_zero = ['cssFoundations.pdf', 'cssCookBook.pdf'];
function pdf_load_zero(pdf, path){
path = path || 'pdf-testing/'; // default path here
var pdfAnchor = '<a href="' + path + '" alt="">Text</a>';
$('#tabs-one1').html(pdfAnchor);
}
pdf_load_zero(css_pdf_zero);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="tabs-one1"></div>

Dennis Kiesel
- 1,902
- 3
- 15
- 20
-
Yeah but it jumps to this window saying at the top Index of /pdf-testing, is there a way I can open a pdf in a separate window to read. – Siyad Nijah Aug 08 '17 at 05:08
-
Please see: https://stackoverflow.com/questions/17711146/how-to-open-link-in-new-tab-on-html – Dennis Kiesel Aug 08 '17 at 05:10