# Print() function wants to print out the whole website

**URL:** <https://discourse.processing.org/t/print-function-wants-to-print-out-the-whole-website/37876>\
**Category:** Beginners\
**Created:** [July 7, 2022, 2:33pm UTC](https://discourse.processing.org/t/print-function-wants-to-print-out-the-whole-website/37876 "2022-07-07T14:33:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![n0x](https://avatars.discourse-cdn.com/v4/letter/n/71e660/32.png) [@n0x](https://discourse.processing.org/u/n0x)\
**Post date:** [July 7, 2022, 2:33pm UTC](https://discourse.processing.org/t/print-function-wants-to-print-out-the-whole-website/37876/1 "2022-07-07T14:33:37Z")

</div>

Whenever I have auto-refresh on and have written print() in draw then it wants to print out the websites like with ctrl + p and then when I try to close the tab I get a new one. I have lost code due to it.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/3/0/30eea091b245703f852f1837b0060cc24b431bb6.png)

I’m wondering if I can disable it.

---

<div class="post-metadata">

**Author:** ![mnse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mnse/32/16520_2.png) [@mnse](https://discourse.processing.org/u/mnse)\
**Post date:** [July 7, 2022, 4:05pm UTC](https://discourse.processing.org/t/print-function-wants-to-print-out-the-whole-website/37876/2 "2022-07-07T16:05:10Z")

</div>

Hi @n0x,

What do you expect by calling the print() in draw ?  
Have you carefully studied the reference of [print function](https://p5js.org/reference/#/p5/print) ?

> Note that calling print() without any arguments invokes the window.print() function which opens the browser’s print dialog. To print a blank line to console you can write print(‘\n’).

Cheers  
— mnse

---

<div class="post-metadata">

**Author:** ![n0x](https://avatars.discourse-cdn.com/v4/letter/n/71e660/32.png) [@n0x](https://discourse.processing.org/u/n0x)\
**Post date:** [July 7, 2022, 6:40pm UTC](https://discourse.processing.org/t/print-function-wants-to-print-out-the-whole-website/37876/3 "2022-07-07T18:40:34Z")

</div>

Thanks, I expected nothing from calling print(). It’s easier to use auto-refresh and I’m usually not fast enough to write something into () so it would automatically invoke the window.print() and I wouldn’t be able to close the tab, thus losing my progress till last save. That’s why I would like to disable it.

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [July 7, 2022, 8:03pm UTC](https://discourse.processing.org/t/print-function-wants-to-print-out-the-whole-website/37876/4 "2022-07-07T20:03:19Z")

</div>

Hello @n0x,

Replace _print_ with _console.log_

Reference:  
[https://p5js.org/reference/#/console](https://p5js.org/reference/#/console)

I did not try it yet… you may want to explore this:

> <https://stackoverflow.com/questions/5409428/how-to-override-a-javascript-function>

`:)`

---

<div class="post-metadata">

**Author:** ![mnse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mnse/32/16520_2.png) [@mnse](https://discourse.processing.org/u/mnse)\
**Post date:** [July 7, 2022, 8:08pm UTC](https://discourse.processing.org/t/print-function-wants-to-print-out-the-whole-website/37876/5 "2022-07-07T20:08:34Z")

</div>

Hi @n0x,

Ok! I think now I’ve understood what you mean. 🙂

You mean on auto refresh, when you typing the print command it adds close bracket before you are able to type something in (), hence on the next draw iteration then opens the window.print dialogue… 🙂

In this case I would recommend to use console.log instead of print … 🙂

Cheers  
— mnse
