Welcome Guest Search | Active Topics | Sign In | Register

Stop Editor from filtering scripts Options
Ray
Posted: Tuesday, November 17, 2009 5:43:58 PM
Rank: Newbie
Groups: Member

Joined: 7/11/2007
Posts: 8
I would like to add a javascript from inside the ASP Editor control a simple onclick="popup();" gets filtered out is there a way to stop this behavior
eo_support
Posted: Tuesday, November 17, 2009 9:30:06 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

There is no way to stop that. The Editor always filters out any JavaScript you put into it for several reasons. One reason is many JavaScript libraries adds all kind of JavaScript methods to all DOM elements (such as prototype), those are not added by the user and must be filtered out; The other reason is the editor have no control over how and what those JavaScript does, which may interfer with various editor functionalities.

If you wish to keep the JavaScript code in your HTML, you can replace them with a place holder attributes (for example, change onclick="popup()" to "click_handler="popup()" before you load the HTML into the editor and then restore them afterwards. The editor should keeps these place holder attributes for you as is unless the node has been deleted by user.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.