0
不工作我用一個小的Java腳本在一個較小的選項卡中打開PDF文檔:彈出來打開PDF在Internet Explorer
// JavaScript Document
function openHeyPopup(objectLink) {
\t window.open(objectLink, "Externer Link", "width=700,height=600,scrollbars=yes");
}
function initHeyPopup()
{
\t
\t if (!document.getElementsByTagName){ return; }
\t var anchors = document.getElementsByTagName("a");
\t // loop through all anchor tags
\t for (var i=0; i<anchors.length; i++){
\t \t var anchor = anchors[i];
\t \t if (anchor.getAttribute("href") && (anchor.getAttribute("rel") == "heypopup")){
\t \t \t anchor.onclick = function() {openHeyPopup(this); return false;}
\t \t }
\t }
}
function addLoadEvent(func)
{ \t
\t var oldonload = window.onload;
\t if (typeof window.onload != 'function'){
\t window.onload = func;
\t } else {
\t \t window.onload = function(){
\t \t oldonload();
\t \t func();
\t \t }
\t }
}
addLoadEvent(initHeyPopup); \t // run initLightbox onLoad
這工作正常Chrome和Firefox。但在Internet Explorer中,我得到一個空的瀏覽器窗口。
http://www.interieursalon.com/wp/wp-content/uploads/2016/08/web-interieursalon-portfolio.pdf
任何人都沒有,我怎麼能解決這個問題的IE?
問候
您是否嘗試過任何調試?它在哪裏失敗?如果您發佈了大量代碼並詢問「爲什麼它不起作用?」,您不太可能得到有用的答案。 – NicolasMoise
另外,你使用的是什麼版本的IE? – NicolasMoise
如果彈出窗口打開,發佈的代碼就起作用了,這很可能與瀏覽器設置,服務器上的服務器設置,或者瀏覽器中使用的Adobe插件有關。 – adeneo