Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/396.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google文档查看器在ASP.Net页面中给出javascript错误_Javascript_Asp.net_Iframe_Master Pages_Google Docs - Fatal编程技术网

Google文档查看器在ASP.Net页面中给出javascript错误

Google文档查看器在ASP.Net页面中给出javascript错误,javascript,asp.net,iframe,master-pages,google-docs,Javascript,Asp.net,Iframe,Master Pages,Google Docs,我正在尝试在我的页面中嵌入谷歌文档查看器。 下面是test.aspx代码: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="Web_Application.test" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD

我正在尝试在我的页面中嵌入谷歌文档查看器。 下面是test.aspx代码:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="Web_Application.test" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>

    <iframe id="documentLoader" src="https://docs.google.com/viewer?embedded=true&url=http://view.samurajdata.se/license.pdf"
 style="width:100%; height:800px;">
 </iframe>
</body>
</html>
我会遇到如下错误:

'Line: 409
Error: Unable to get value of the property 'k': object is null or undefined'

来自谷歌文档查看器在线javascript资源

因此,我将脚本嵌入到了标题中,它成功了。但问题是,如果在用户控件或从母版页继承的页面中执行此操作,则会再次出现这些错误

我怎样才能解决这个问题


谢谢。

尝试独立于任何浏览器或版本的iframe脚本,这将正常工作

<iframe id="documentLoader" src="https://docs.google.com/viewer?url=http://view.samurajdata.se/license.pdf&chrome=true" style="width: 100%; height: 800px;">
</iframe>

如果有效,请标记是!!!:)



不幸的是,它没有。我只是得到了更多的java脚本错误。我需要找一个在ASP.NET上尝试过这个的人。你在浏览器中键入过那个url吗。。。设置代码块格式时有没有错误?每行缩进四个空格。看看你是否自己找到了这个问题的解决方案,请用你自己的答案更新这个问题,并将其标记为已接受。这也会提高你的低接受率。
'Line: 458
Error: Unable to get value of the property 'a': object is null or undefined'
<iframe id="documentLoader" src="https://docs.google.com/viewer?url=http://view.samurajdata.se/license.pdf&chrome=true" style="width: 100%; height: 800px;">
</iframe>
<iframe id="documentLoader"
        src="https://docs.google.com/viewer?url=http//view.samurajdata.se/license.pdf&embedded=true"
        style="width:100%; height:800px;">