Good afternoon:
This small html code works when run alone in my browser but not when it's embedded in our website. In the website, the print button "is hot" to the mouse pointer but it doesn't bring up the printer function.
<html>
<script>
function printpage()
{
window.print();
}
</script>
<body>
<p> Please print and fill out donation slip and mail with your donation. Thanks.</p>
<button onclick="printpage()">PRINT</button>
</body>
</html>
Any help you can give would be much appreciated. Thanks. Michael
HTML Code Not Working When Ebbeded
- Albert Wiersch
- Site Admin
- Posts: 3785
- Joined: Sat Dec 11, 2004 9:23 am
- Location: Near Dallas, TX
- Contact:
Re: HTML Code Not Working When Ebbeded
Maybe a conflict with the function name printpage and another function or variable?
Does this work?
Does this work?
Code: Select all
<button onclick="window.print()">PRINT</button>
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
Re: HTML Code Not Working When Ebbeded
Thanks for the suggestion but it doesn't work. Any other thoughts? Thanks. Michael
Re: HTML Code Not Working When Ebbeded
Hello Albert. Just found this out. We're using Google Sites and they do not allow popup windows! So, a print button will never work. Thanks for your help and I really appreciate your time and efforts. Regards, Michael
- Albert Wiersch
- Site Admin
- Posts: 3785
- Joined: Sat Dec 11, 2004 9:23 am
- Location: Near Dallas, TX
- Contact:
Re: HTML Code Not Working When Ebbeded
You're welcome!
I had also thought that something might be blocking it.
Thank you for posting back with what you found.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial