wishchaser
wishchaser

Reputation: 628

Some scripts stopped working after SSL installation

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.

Upvotes: 0

Views: 5903

Answers (1)

ceejayoz
ceejayoz

Reputation: 180023

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.

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.

Upvotes: 7

Related Questions