jquery - onclick print content which inside the iframe -


i facing problem on print content inside iframe.

this anchor tag outside iframe :

<a href=”#” onclick='window.print()' >print</a> 

here iframe

<iframe name="newtest"  src="https:xyz.com" ></iframe> 

i want print page inside iframe on click of anchor tag outside iframe

<iframe src="" id="iframeid"></iframe>  document.getelementbyid("iframeid").contentwindow.print(); 

if trying print remote site, can't in way.

if http://yoursite.org , iframe <iframe src="http://google.com"> can't that, site domain must match

instead if page local page <iframe src="page.htm"> work


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -