Since this is an ajax call, the iframe must be encoded differently. Check out this site, there are some solutions ... Site
small modification of the code on the website to open pdf.
page1.html
<!DOCTYPE html> <html> <head> <title>Demo Page</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" /> <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script> <script type="text/javascript" src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script> <script type="text/javascript" src="js/main.js"></script> </head> <body> <div data-role="page"> <div data-role="header"> <h1>Demo Page</h1> </div> <div data-role="content"> <a href="page2.html" data-role="button">Another Page</a> <a href="#" id="perform-function" data-role="button" data-link="FocusFree.pdf">Perform Function</a> </div> </div> </body> </html>
Page2.html
<!DOCTYPE html> <html> <head> <title>Another Page</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" /> <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script> <script type="text/javascript" src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script> </head> <body> <div data-role="page" data-add-back-btn="true"> <div data-role="header"> <h1>Another Page</h1> </div> <div data-role="content"> <p>This is another page, dude.</p> </div> </div> </body> </html>
main.js
$(document).ready(function(){ $('#perform-function').bind('click', function(){
srivenky
source share