Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Setting text in JavaScript for HTMLEditor after Page was loaded

$
0
0

Hi!

I was trying AjaxControlToolkit and find it very useful, so thanks for that!

Unfortunately I have one trouble with AjaxControlToolkit.HTMLEditor.

I need to put some text in editor after page was loaded (in JavaScript)

Current it looks like:

<body><form id="form1" runat="server"><script type="text/javascript">
        	    window.onload = setContent;
        	    //window.onload = function() { alert("It's loaded!") };

        	    function updateParentPage() {
        	        $find('editor').set_content('sample');
        	        window.returnValue = $find('editor').get_content();
        	        self.close();
        	    }
        	    function setContent() {
					$find('<%= editor.ClientID %>').set_content('Text content');

        	    }
    
    </script>
...

I am getting Error: 'null' is null or not an object JS exception.

I think this is because of not fully loaded HTML Editor:

Error


How can I avoid this (and get HTMLEditor fully loaded) to set the text in the HTMLEditor via JS?

Thanks.


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>