This is a migrated thread and some comments may be shown as answers.

script error in IE when leaving page if jquery is also used

1 Answer 49 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
lachlan roche
Top achievements
Rank 1
lachlan roche asked on 17 Aug 2010, 05:46 AM
When we use RADEditor and jQuery on the same page, IE 6/7/8 throw a script error during page unload.
We use $telerik.addExternalHandler and editor.attachEventHandler. No jQuery event handlers are used.

This is version 2010.1.519.35 of Telerik.Web.UI.

The exception is:
Error: Sys.ArgumentNullException: Value cannot be null.
Parameter name: element

The JScript call stack:
JScript anonymous function
JScript anonymous function
Sys$Application$_unloadHandler
Sys$Application$Dispose
JScript anonymous function
JScript anonymous function
Sys$Ui$DomEvent$removeHandler

The inner most anonymous function is from Telerik.Web.UI.Editor.RadEditor.js, and the call to removeHandler is from this code:
},_registerModeChangeHandler:function(c){if(c){this._onModeButtonClickDelegate=Function.createDelegate(this,this._onModeButtonClick);
$addHandler(this._getModeButtonsWrapper(),"click",this._onModeButtonClickDelegate);
}else{if(this._onModeButtonClickDelegate){$removeHandler(this._getModeButtonsWrapper(),"click",this._onModeButtonClickDelegate);
this._onModeButtonClickDelegate=null;
}}},_onModeButtonClick:function(h){var g=this.get_mode();


A workaround is to add the following as the last script on the page:

<!--[if IE]>
<script type="text/javascript">
    (function() {
        var remove = window.$removeHandler;
        window.$removeHandler = function(a,b,c) {
            if (a) {
                remove(a,b,c);
            }
        }
    })();
</script>
<![endif]-->

1 Answer, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 19 Aug 2010, 01:17 PM
Hi lachlan,

Do you use an external jQuery library? if so, I recommend you to use the one embedded in Telerik assembly. More details about how to use jQuery object can be found in this help article.

Additionally, I recommend you to update to the recent version of the RadControls - 2010.2 713.

I hope this helps.

Regards,
Fiko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
lachlan roche
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Share this question
or