Search code examples
javascriptjqueryexceptionwysiwyg

jquery wysiwyg throws "Object doesn't support this property or method" on postback


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?


Solution

  • 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.