Hi Wix, I urgently require the ability to print a page. window.print(); doesnt seem to work. Can you kindly implement this basic feature?
We are launching in a few days and this is a major holdup
Best
Hi Wix, I urgently require the ability to print a page. window.print(); doesnt seem to work. Can you kindly implement this basic feature?
We are launching in a few days and this is a major holdup
Best
Hi Mustafa,
The window.printf() doesn’t work due to the structure of a WixCode website. The code is sandboxed and the use of HTML and Javascript is strictly limited. You can embed HTML code by using a $w.HtmlComponen t (and iFrame), but you still won’t be able to print a full web page - just the contents of the HtmlComponent itself. Then again, maybe you can include enough in your HtmlComponent that it will serve your purposes - if only on a temporary basis.
Feel free to request this feature in the Feature Request forum .
Thank you for your interest in WixCode.
Have fun,
Yisrael
I thought this was in the Feature Request Forum? I could use this feature as well.
If you will insist upon restricting .print() to be implemented within wix, forbidding a programmer to internally request a .print() call, then would you kindly please allow the request to be sent up to the window object?
WixCode understands all of Javascript, except for anything that accesses the DOM.
This keeps the user from inadvertently “breaking” something. I myself tried to hack things from the code, from an iFrame, and in my dreams, but WixCode wasn’t having any of it.
Accessing document elements such as div, span, button, etc is off-limits. The way to access elements on the page is only through $w.
As I mentioned before, one small exception is the $w.HtmlComponent (which is based on an iFrame). This element was designed to contain vanilla HTML and it works just fine. You just can’t try to trick it by using parent, window, top, etc.
Hi, I'm a rookie at Wix, and I have the same problem. I have made a form inside a box. How can I print it? putting the code window.print (); it does not work, and putting $w("# box_name").print, either. Any suggestions? Thank you.
It won’t work - WixCode understands all of Javascript, except for anything that accesses the DOM.
Thank you very much, Ysrael. I have been researching and it seems that the only way to print a form would be by adding an html element, but I do not know if it could be put inside the box and all the fields and that these would remain functional (connected to the database, allowing calculated fields. ..) The truth is that I do not even know where to start.
(Please post as regular text and not as code since it’s very hard to read.)
I would suggest visiting the following sites for information on programming in Wix Code and Javascript:
https://support.wix.com/en/wix-code/wix-code-basics
https://www.w3schools.com/js/default.asp
https://javascript.info
Also, play with the examples:
https://support.wix.com/en/article/wix-code-index-of-examples
https://www.wix.com/code/home/examples
https://www.grampsworkbench.com/examples
Thanks, i take a look.
Hi Yisrael
I use this inside the html component and also the onmessage and postmessage function but the print is not working but it was working before:
Print this pageCan you check and try it your self? even i dont use the postmessage and on message, still the print function doesnt work. Im guessing something change in html, maybe?
Thanks,
DA
Luckly in my first job on Wix i to print a worksheet. What about printing functionality?
If this functionality is released, the team will notify us on the Tips & Updates page.
Hi everybody,
Feel free to take a look at our newest component: Custom Element .
You’ll probably find it useful for this specific issue.