I use the following code to print the contents inside a div element. This worked fine for me until I installed a SSL certificate in my server. The code still functions if I access the page via http://
. However it is not working when the same page is accessed via https://
. I need help solving this problem.
function PrintElem(elem)
{
Popup($(elem).html());
}
function Popup(data)
{
var mywindow = window.open('', 'Business Sense Chart', 'height=600,width=1200');
mywindow.document.write('<html><head><title>Business Sense Analytics</title>');
mywindow.document.write('<link rel="stylesheet" href="./css/style.css" type="text/css" />');
mywindow.document.write('</head><body><center>');
mywindow.document.write(data);
mywindow.document.write('</center></body></html>');
mywindow.print();
return true;
}
Note: When I used firebug to diagnose the bug, it showed the error "$ is not a function". Similar other scripts are facing the same problem.
I use the following code to print the contents inside a div element. This worked fine for me until I installed a SSL certificate in my server. The code still functions if I access the page via http://
. However it is not working when the same page is accessed via https://
. I need help solving this problem.
function PrintElem(elem)
{
Popup($(elem).html());
}
function Popup(data)
{
var mywindow = window.open('', 'Business Sense Chart', 'height=600,width=1200');
mywindow.document.write('<html><head><title>Business Sense Analytics</title>');
mywindow.document.write('<link rel="stylesheet" href="./css/style.css" type="text/css" />');
mywindow.document.write('</head><body><center>');
mywindow.document.write(data);
mywindow.document.write('</center></body></html>');
mywindow.print();
return true;
}
Note: When I used firebug to diagnose the bug, it showed the error "$ is not a function". Similar other scripts are facing the same problem.
Share Improve this question edited Jul 26, 2013 at 18:14 Mogsdad 45.8k21 gold badges162 silver badges285 bronze badges asked Jul 26, 2013 at 16:39 wishchaserwishchaser 6282 gold badges7 silver badges19 bronze badges 1-
3
Are you perhaps including the script using a
http
link (instead ofhttps
). Browsers block non-secure content by default. – Halcyon Commented Jul 26, 2013 at 16:40
1 Answer
Reset to default 7Note: When I used firebug to diagnose the bug, it showed the error "$ is not a function". Similar other scripts are facing the same problem.
You are most likely loading jQuery off an HTTP URL (CDN, perhaps?), which causes browsers to block it as insecure. All assets - images, scripts, CSS, etc. - need to be HTTPS on a HTTPS page.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742371548a4431365.html
评论列表(0条)