<html>
<head>
<script type="text/javascript">
var URL = "http://localhost:8000/foobar/";
var W = window.open(URL); **Note1**
W.window.print();
</script>
</head>
<p> Print ME...............</p>
</html>
I am using this script to print a webpage. My views render this page and The JS take care all other things.
But I dont want to open new window for that. So, What should I use instead of window.open(URL)
so no new window
opens. Similarly, I don't want to open new window for print function
.So, Whenever I render this page it do all stuff on the same page. No new window, No new tab. How can I achieve this. I google but nothing seems working.