Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I am very new to jQuery. I have a page on my site with 10 anchor tags alongside an iframe which is embedded for PDF view. How can I load the anchor tags with respective URL's dynamically using Jquery. I have the URL list in xml file.

XML
<a class="ShowPDF1" href="URL to the PDF location" target="pdfframe"></a>

<iframe id="pdfframeID" name="pdfframe" height="650" width="900" frameborder="1"></iframe>

Any help would be greatly appreciated. Thanks
Posted

1 solution

Assign and id to your anchor.

HTML
<a id="test" href="#"></a>


Then you can try to get the element
JavaScript
var anchorHref = $(this).attr('href');
//in your case it might the iframe. So you may need to adapt it or get it with jquery as well
window.open(url, '_blank');
 
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