How do I force an HTML snippet to execute? - Forum
This discussion started in May 2015. EverWeb has changed a lot since then, so some answers may no longer apply.
These current help articles may help:
Find up-to-date answers in the EverWeb help articles. Still stuck? Start a new thread or contact support.
How do I force an HTML snippet to execute?
|
User: Daniel B. 11 years ago
|
|
|
As an HTML snippet, I have injected a piece of code to bring up the printer window when you open a new page. For example, when you click the blue button "PRINT YOUR OFFER" on this page,, it brings up the new page along with the printer interface. But when you click the blue button "PRINT YOUR OFFER" on this page,, it brings up the new page WITHOUT the printer interface. The two pages are identical, with the name HTML (Javascript) snippet on both. What am I missing? Thank you! <HTML SNIPPET:> <script> window.onload = function() { window.print(); } </script> |
|
|
User: Jumbo T. 11 years ago
|
|
|
Remove the HTML Snippet and paste this code in the Footer Code box of the page. <script> $(document).ready(function() { window.print(); }); </script> Here you can read the difference : https://forum.jquery.com/topic/document-ready-and-window-onload-difference |
|
|
✔ Best Answer
|
|
|
User: Daniel B. 11 years ago
|
|
| Perfect! Thank you, sir or madam! | |
| Post Reply |
| You must login or signup to post. |
