Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8189503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:17:56+00:00 2026-06-07T03:17:56+00:00

Why is this getting ‘cannot call method getContent of undefined’ , how is this

  • 0

Why is this getting 'cannot call method getContent of undefined', how is this possible? It sets up my textarea with tinyMCE but can’t do getContent.

tinyMCE.init({
            plugins: 'paste',
            theme : "advanced",
            mode : "specific_textareas",
            editor_selector : element,
            width : width,
            theme_advanced_buttons1 : "bold,italic,underline,strikethrough,bullist,numlist,undo,redo,",
            theme_advanced_buttons2 : "",
            theme_advanced_buttons3 : "",
            theme_advanced_toolbar_location : "top",
            theme_advanced_toolbar_align : "left",
            content_css : "hhhng.css",
            paste_text_sticky : true,
            //select pasteAsPlainText on startup
            setup : function(ed) {
                    ed.onInit.add(function(ed) {
                    ed.pasteAsPlainText = true;
                });
            }
});
var x = tinyMCE.get(element).getContent();

Update

Works when I call from a button click but why wouldn’t it work immediately after tinymce is initialise? And yes it’s in a document ready block. It’s not making sense to me :S

$("#button").click( function(e) {

    e.preventDefault();
    console.log(tinyMCE.activeEditor.getContent());

});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T03:17:58+00:00Added an answer on June 7, 2026 at 3:17 am

    Even though it’s in a document ready block it might be that TinyMCE doesn’t create itself immediately when init is called. If you’re wanting to run code once it’s initialised then you should see if it provides a method of passing a callback function. It will then call this function once it’s got itself ready.

    In fact it looks like you’re already using such a function with this bit of code:

    //select pasteAsPlainText on startup
    setup : function(ed) {
            ed.onInit.add(function(ed) {
            ed.pasteAsPlainText = true;
        });
    }
    

    Just add your post init code to that function body.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have found this: Getting the size of a QGraphicsView But I can't figure
Getting this. Site works fine locally, but up on production server I get this
This is getting made in a static void method in the main class. (class
This question can be very simple but could not find the answer; I receive
This is getting called in onCreate(), how can I speed up orientation switching? private
Im getting this error: FileLoaderLoadException: Cannot import resource app/config/security.yml from /app/config/config.yml. The file security.yml
This is getting me quite confused: I have a small application that uses a
Getting this out of the way; I don't frequently do much in php or
Getting this weird LINQ error. title = System.Linq.Enumerable+WhereSelectEnumerableIterator`2[System.Xml.Linq.XElement,System.String Here is the code I have:
Am getting this error message and matched my brackets and couldn't find anything wrong.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.