Java Genies

May 26, 2015

Hi all,

Some time ago I cam across the attached template for emailing and printing users' written comments from the AS lesson. I have had success with the Java script to print and email these comments but only fully on Google Chrome. On Internet Explorer and Firefox, only the email feature works. The print button on IE is dead and on Firefox when the printer icon in the lesson is clicked it just launches a blank page. Does anybody know what needs to be done to the Java Script below to get printing working across browsers? 

Any advice is much appreciated! 

var myWindow = window.open("","Print","width=810,height=610,scrollbars=1,resizable=1");
var player=GetPlayer();
var headline=player.GetVar("PrintTitle");
var date=player.GetVar("SystemDate");
var usernotes=player.GetVar("notes");
var exercisenotes1=player.GetVar("Thoughts1");
var exercisenotes2=player.GetVar("Thoughts2");
var exercisenotes3=player.GetVar("Thoughts3");
var contents = "<html><head></head><body style='width:650px;padding:20px;'>"
contents += "<div style='height:20px;padding:10px;margin-bottom:20px;text-align:center;'><button onclick='javascript:window.print();'>Print My Notes</button></div>";
contents+="<div style='font-size:22px;font-weight:bold;margin-top:20px;margin-bottom:20px;'>"+headline+"</div>";
contents+="<div style='font-size:16px;'>"+date+"</div>";
contents+="<div style='font-size:18px;font-weight:bold;margin-top:10px;'>Activity Notes - My thoughts on Non-Discrimination</div>";
contents+="<div style='font-size:17px;margin-top:5px;'>"+exercisenotes1+"</div>";
contents+="<div style='font-size:18px;font-weight:bold;margin-top:10px;'>Activity Notes - Situations I would report to the Values Line</div>";
contents+="<div style='font-size:17px;margin-top:5px;'>"+exercisenotes2+"</div>";
contents+="<div style='font-size:18px;font-weight:bold;margin-top:10px;'>Activity Notes - Examples of Conflict of Interest</div>";
contents+="<div style='font-size:17px;margin-top:5px;'>"+exercisenotes3+"</div>";
contents+="<div style='font-size:18px;font-weight:bold;margin-top:10px;'>General Notes</div>";
contents+="<div style='font-size:17px;margin-top:5px;'>"+usernotes+"</div>";
contents+= "</body></html>"
myWindow.document.write(contents);

Be the first to reply

This discussion is closed. You can start a new discussion or contact Articulate Support.