jquery wysiwyg 抛出“对象不支持此属性或方法” 回发时

发布于 2024-07-29 10:35:39 字数 551 浏览 3 评论 0原文

我有一个在其上应用的文本框 jq wysiwyg:

public static void PopulateWysiwyg(this SafeTextBox tb)
{
    string script =
@"
jQuery(document).ready(function()
{
    jQuery('#safe_text_box').wysiwyg();
});
";

    ScriptManager.RegisterStartupScript(
        tb,
        tb.GetType(), 
        tb.ClientID + "_wysiwyg", 
        script.Replace("safe_text_box", tb.ClientID), true
    );
}

当我单击表单上的回发按钮时,wysiwyg js 抛出异常: java 脚本异常

有帮助吗?

I have a textbox which i applied on it jq wysiwyg:

public static void PopulateWysiwyg(this SafeTextBox tb)
{
    string script =
@"
jQuery(document).ready(function()
{
    jQuery('#safe_text_box').wysiwyg();
});
";

    ScriptManager.RegisterStartupScript(
        tb,
        tb.GetType(), 
        tb.ClientID + "_wysiwyg", 
        script.Replace("safe_text_box", tb.ClientID), true
    );
}

When I click a postback button on the form, the wysiwyg js throws an exception:
java script exception

Any help?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

嘦怹 2024-08-05 10:35:40

您看到 wysiwyg 插件中注释掉的代码了吗? 重新启用该代码并取出上面的 return 语句。 该代码实现了浏览器感知位,这将使代码在 IE 中工作。

Do you see the bit of code that is commented out in the wysiwyg plugin. Re-enable that bit of code and take out the return statement above it. That code implements the browser-aware bit that will make the code work in IE.

遥远的绿洲 2024-08-05 10:35:40

看起来 IE 不支持 contentWindow.document - 我认为代码需要类似于..

return

element.contentWindow ?
element.contentWindow.document :
ownerDocument

It looks like IE doesn't support contentWindow.document - I think that code needs to be something like..

return

element.contentWindow ?
element.contentWindow.document :
ownerDocument
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文