javascript - Print data attribute of object tag -


i trying setup system can call browser's print function print data attribute of object tag. i.e. have object tag pdf content, , want way when press button can print pdf.

this have.

<head>   <script type="text/javascript">     function printme () {       var test = document.getelementbyid('pdf');       test.focus();       test.print();     }   </script> </head>  <body>   <object data="test.pdf" type="application/pdf" id="pdf"></object>   <button onclick="printme()">print!</button> </body> 

now keep getting error, uncaught typeerror: undefined not function when click button. doing wrong here , how set properly?


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -