I am using the javascript API to fetch documents and display them using the html5 viewer. The containing page is displayed using https. It was working fine until recently in Chrome I started seeing this in the console:
It appears that the 4gen.js is being referenced using http instead of https, and Chrome blocks it, thus causing subsequent javascript to fail. My javascript code is as follow:
// prepare the scribd doc
var scribdDoc = scribd.Document.getDoc(docId, accessKey);
var onDocReady = function(e) {
// console.log("ready");
scribdDoc.api.setPage(1);
};
try {
scribdDoc.addParam("jsapi_version", 2);
scribdDoc.addParam("use_ssl", true);
scribdDoc.addParam("page", 1);
scribdDoc.addParam("mode", "slideshow");
scribdDoc.addParam("width", "100%");
scribdDoc.addParam("height", parseFloat(percentage)/100 * modalHeight);
scribdDoc.addEventListener("docReady", onDocReady);
scribdDoc.write(embeddedDocId); // the id of the container to hold the previewer
} catch (e) {
console.log(e);
}
This is only failing in Chrome 24. Firefox, Safari, and IE 8 still render the viewer. Anything I'm doing wrong, or any tips or workarounds?