Forum Discussion
Print button - javascript
Hi, I would like to add a button that would allow the user to print the page. It seems like the easiest way would be to add a trigger to a button to execute javascript. Unfortunately, I know nothing of javascript. Can someone help me out with what need to goes into that script box?
Thank you!!
69 Replies
- stevenrogersCommunity Member
Has anyone come across any problems using this with Chrome/Firefox? It seems to work fine every time through IE but randomly when I click the button the preview will come up blank, and print a blank page for both Chrome and Firefox even though it's the exact same course that is working in IE.
- GunjanKothariCommunity Member
@steven rogers, I have faced the same problem, and the reason was height of the page. You must give some height to your page to get the result in Print Preview / Print
- JimHandysideCommunity Member
Tested the print script in IE - works fine.
Fails in Chrome - java-related browser issue?
- NancyWoinoskiSuper Hero
Hi Jim, I think it is a browser security issue. Where you testing locally or over the internet?
Chrome blocks javascript when running locally.
- JimHandysideCommunity Member
thanks Nancy - that's the hang on this, works fine when run outside the network on web
- GrantRobertson1Community Member
Hi all. Just wondering if anyone else is having trouble using the print script in conjuncton with Firefox browser? Works fine in IE but comes up blank in Firefox. The file is posted to the web.
- GrantRobertson1Community Member
Hello again. I guess my question may not have been phrased in the best way, seeing as there have been no responses.
Are folks out there using Firefox and having success with the window.print() function from a Storyline course mounted on a website? When I run IE I get my printed page in portrait.
When I run Firefox (on a Windows 7, 64 bit system with the latest version of Flash [also taking away the protected mode] and Java), the page comes out blank.
Any clues about what I might do to make Firefox work for me?
Many thanks in anticipation.
- NancyWoinoskiSuper Hero
Hi Grant - I have the same setup as you Windows 7, 64 bit and I just created a little SL project that has a button with the javascript to print the page when clicked. It is nothing special but I published and tried running it locally using Firefox and it worked fine.
I tested it on Firefox version 15.0.1 and Firefox version 16.0.2 and it worked fine on both.
You say the course is mounted on a website so I am wondering if it is a firewall issue.
I have uploaded the storyline file that I used. I know it works so try it and see if it works for you. If it doesn't then there is some issue with your browser configuration or your network security.
- GrantRobertson1Community Member
Hello Nancy. Thanks so much for this.
Unfortunately, no joy on my side with this slide - at least I can go ahead and seek out the cause knowing that someone using a similar system has been successful! That's a great pace to start.
- NancyWoinoskiSuper Hero
This might be a stupid question, but do you have JavaScript enabled in the Firefox options?
- GrantRobertson1Community Member
Hi Nancy, not at all a stupid question, but sadly, this is something that I had checked and yes, it is enabled. Still, unable to print the file you were able to print after quite a lot more time wasted.
In case others may have similar problems, what I have learned is that similar problems have been exprienced by others in the past both in Storyline (and this thread is an example) and also with Firefox and all sorts of programs more generally. It has to do with Firefox usually not liking to print windows via flash apparently. In fact, there is a public, unallocated bugfix request (and a whole lot of duplicate requests) for the Firefox team that goes back to 2002! Much teeth gnashing in the Firefox and other forums about this.
My work-around will be simply to warn users that the print feature works in IE but is not guaranteed to work in Firefox. I'll add ablank pdf to the Resources section which they could print out if the auto-print I've set up (and which works in IE) fails them.
Thanks again Nancy for your very kind and prompt support.
Related Content
- 6 months ago