类型错误:this.$E_0.getElementsByTagName 不是函数
我正在尝试在 sharepoint 2010 中创建模式对话框,但收到此错误:
TypeError: this.$E_0.getElementsByTagName is not a function
我的代码是:
var options = SP.UI.$create_DialogOptions();
options.html = '<div class="ExternalClass23FFBC76391C4EA5A86FC05D3D9A1904"><p>RedConnect is now available.</p></div>';
options.width = 700;
options.height = 700;
SP.UI.ModalDialog.showModalDialog(options);
使用 firebug,我尝试简单地使用 url 字段而不是 html 字段,并且没有给出错误。
也与此相关,SP.UI.$create_DialogOptions() 实际上做了什么?使用它和简单地使用值字典作为您的选项有什么区别?
I am attempting to create a modal dialog in sharepoint 2010, but I'm getting this error:
TypeError: this.$E_0.getElementsByTagName is not a function
my code is:
var options = SP.UI.$create_DialogOptions();
options.html = '<div class="ExternalClass23FFBC76391C4EA5A86FC05D3D9A1904"><p>RedConnect is now available.</p></div>';
options.width = 700;
options.height = 700;
SP.UI.ModalDialog.showModalDialog(options);
using firebug, i tried simply using the url field instead of the html field and it gave no error.
also related to this, what does SP.UI.$create_DialogOptions() actually do? what is the difference between using it and simply using a dict of values for your options?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
options.html
需要 HTML DOM 元素而不是纯 HTML 代码:示例代码取自博客文章 在 SharePoint 对话框中呈现 html 需要 DOM 元素而不是字符串。
当您查看 SP.UI 文件中的
SP.UI.DialogOptions
“类”的定义时。 Dialog.debug.js 你会看到它是一个空的 javascript 函数。我的猜测是它是为了客户端诊断目的而存在的。看看这个问题:这段 Javascript 代码是做什么的?
options.html
requires a HTML DOM element instead of plain HTML code:Example code taken from the blog post Rendering html in a SharePoint Dialog requires a DOM element and not a String.
When you look at the definition of the
SP.UI.DialogOptions
"class" in the file SP.UI.Dialog.debug.js you see that its a empty javascript function.My guess is that it is there for client diagnostic purpose. Take a look at this SO question: What does this Javascript code do?