javascript - IE9 <a> 在直接加载的页面中工作,但在通过链接页面访问时不起作用

标签 javascript html internet-explorer-9 cross-domain

此问题不需要跨浏览器解决方案,因为页面将专门由 IE9 使用。

话虽如此,我正在开发一个页面 (myPage),它可以访问来自不同域的页面 (linkedPage)。 linkedPage 内有一个 PDF 附件 (pdfAttachment)。

myPage URL:http://myDomain/files/myPage.html

linkedPage URL:https://na13.salesforce.com/article/x.html

pdf附件 URL:https://c.na13.content.force.com/servlet/x.pdf

当用户通过 window.open 触发linkedPage的打开时:

window.open('https://na13.salesforce.com/article/x.html', '_blank', 'toolbar=no, scrollbars=yes, resizable=yes, top=300, left=500, width=1000, height=600');

然后单击 .pdf 附件的链接,

<a href="https://c.na13.content.force.com/servlet/x.pdf" target="_blank">Load x.pdf</a>

返回错误

Internet Explorer cannot display the webpage.

但是,如果用户直接加载linkedPage(相对于myPage上的链接),则pdfAttachment加载不会出现问题。 p>

我无法控制linkedPagepdfAttachment页面,但可能有一个组可以控制这些主机myPage也是最后的手段。

这是跨域问题吗?我并没有尝试运行脚本或操作内容,因此我对此的理解不够深入,它似乎不适合。

是否存在可能导致该问题的 IE9 设置?

我觉得它可能与 window.open 有关,但无法在这里或通过其他网站找到任何内容。 window.open对其加载的页面有任何限制吗?

还有哪些其他可能的原因可能导致此问题?

谢谢大家!

其他信息

在解决此问题时,我发现我能够从 myPage 访问 linkedPage 并在具有完全互联网访问权限的系统上成功打开 pdfAttachment而其大多数用户只能通过有限的互联网访问白名单项目(其中 linkedPagepdfAttachment 都是)。

此外,当用户单独访问linkedPage(而不是从myPage)时,他们会通过 Citrix 登录,然后登录 Salesforce。当从 myPage 访问 linkedPage 时,系统只会提示他们登录 Salesforce。我不确定这是否会产生影响,因为具有完全互联网访问权限的系统在不首先通过 Citrix 的情况下仍然可以成功。

会不会有权限问题?!

@jdu - 这是标记

<body>
 <div class="knowledgePrintableView" id="knowledgePrintableView">
  <div id="articlePrintableView:j_id3:j_id4:j_id24">
   <div class="knowledgePrintableViewContent " id="knowledgePrintableViewContent">
    <div class="sectionContent">
     <table>
      <tr>
       <td class="fieldValue">
        <span id="articleX">
         <div>
           <img src="/sfc/images/docicons/doctype_pdf_16.png" alt="PDF" title="PDF" />
           <!-- Only the text node exists within the <a> tag -->
           <a href="https://c.na13.content.force.com/servlet/fileField?id=pdfAttachment" target="_blank">PDF Attachment.pdf</a>
         </div>
        </span>
       </td>
      </tr>
     </table>
    </div>
   </div>
  </div>
 </div>
</body>

最佳答案

When troubleshooting this, I discovered that I was able to access linkedPage from myPage and open pdfAttachment successfully on a system with full internet access while the majority of its users will have limited internet access to whitelisted items only (of which both the linkedPage and pdfAttachment are).

嗯!然后我会把你的搜索集中在那里。您在该 anchor 标记中使用 HTTPS 链接,并尝试通过其他一些系统进行路由。这些其他系统可能不允许 HTTPS 流量。

尝试非安全链接。

关于javascript - IE9 <a> 在直接加载的页面中工作,但在通过链接页面访问时不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29928882/

相关文章:

html - 固定元素在 Internet Explorer 9 中消失

javascript - 如何将标签转移到另一个容器

javascript - 更改 Kendo UI DataViz 迷你图的垂直偏移需要什么?

java - 在网页上的表格中显示值

javascript - Foundation 6 中不存在 small-only 均衡器?

javascript - 在 IE 中使用 JavaScript 将 XML 加载到 DIV 时出现问题

javascript - 如何在单击其他元素时编辑所有 href 标签?

javascript - 我正在尝试将图像从数组添加到我的 flickity 轮播中并使用 for 循环

javascript - 将 Bootstrap 弹出窗口添加到特定的 div 元素

javascript - IE9 中的选择问题 - 在其他浏览器中它工作正常