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
|
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!
|