【发布时间】:2015-04-28 20:06:20
【问题描述】:
这个问题不需要跨浏览器的解决方案,因为页面将被 IE9 专门使用。
话虽如此,我正在开发一个页面(myPage),它可以访问来自不同域(linkedPage)的页面。在linkedPage 中有一个PDF 附件(pdfAttachment)。
myPage 网址:http://myDomain/files/myPage.html
linkedPage 网址: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 无法显示该网页。
但是,如果用户直接加载 linkedPage(相对于 myPage 上的链接),pdfAttachment 加载不会出现问题。 p>
我无法控制 linkedPage 或 pdfAttachment 页面,但可以让组控制这些主机 myPage也是最后的手段。
这是一个跨域问题吗?我并没有尝试运行脚本或操纵内容,所以我对此的理解不够深入,它似乎不适合。
是否存在可能导致该问题的 IE9 设置?
我觉得它可能与 window.open 有关,但在这里或通过其他网站找不到任何东西。 window.open 是否对其加载的页面有任何限制?
还有哪些其他可能导致此问题的原因?
谢谢大家!
其他信息
在解决此问题时,我发现我能够从 myPage 访问 linkedPage 并在具有完全互联网访问权限的系统上成功打开 pdfAttachment而其大多数用户只能访问白名单项目(其中 linkedPage 和 pdfAttachment 都是)。
此外,当用户访问 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>
【问题讨论】:
-
你能分享(jsfiddle.net)这个页面的 HTML:na13.salesforce.com/article/x.html
-
也许您可以使用 google 文档查看器?它使用起来非常简单,可以解决大多数浏览器问题。 docs.google.com/viewer
-
@jdu - 不幸的是,我认为我做不到,因为 linkedPage 和 pdfAttachment 需要凭据才能访问。
-
如果您查看源代码并复制/粘贴到 pastebin... 我想查看您的 标记周围使用的标记,因为 IE(尤其是旧版本)对使用有效/正确非常挑剔锚标记的标记。基本上不要将一堆其他元素包裹在一个锚中。
-
@khuderm - 我不确定这会起作用,因为它们( linkedPage 和 pdfAttachment )处理专有信息。
标签: javascript html internet-explorer-9 cross-domain