I am trying to print a part of a page with a single button click without opening a different page . The part of the page that i need to print has been called using ajax so if anybody could help me i would be really thankful
Use the CSS media print to control how your page is printed and then just use window.print(). No need to call another page. You can hide parts of your page this way (side menus and so forth).