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 6935623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:07:38+00:00 2026-05-27T12:07:38+00:00

The following method: Init: function (selector, settings) { setTimeout(function() { var s = {

  • 0

The following method:

Init: function (selector, settings)
{
    setTimeout(function()
    {
        var s =
        {
            width: '100%',
            script_url: '/Content/Scripts/tiny_mce/tiny_mce.js',
            theme: "advanced",
            plugins: "autolink,lists,pagebreak,style,layer,table,paste,directionality,noneditable,visualchars,xhtmlxtras,template",
            theme_advanced_buttons1: "fontselect,fontsizeselect,|,bold,italic,underline,forecolor,backcolor,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist",
            theme_advanced_buttons2: "",
            theme_advanced_buttons3: "",
            theme_advanced_buttons4: "",
            theme_advanced_more_colors: false,
            theme_advanced_toolbar_location: "top",
            theme_advanced_toolbar_align: "left",
            theme_advanced_statusbar_location: "none",
            theme_advanced_resizing: false,
            convert_urls: !!$(selector).data("richEditor-ConvertUrls") // by default we don't convert urls
        };
        $.extend(s, settings);
        $(selector).tinymce(s);
    },0);
}

works on all browsers,
for some reason, I need the setTimeout(f,0) call for firefox, this method is called on an ajax partial load on MVC, without this call, the editor hangs on firefox and the page breaks (clicking on stuff results on exceptions most often than not). with the call, everything works perfectly.

I was wondering how I could avoid this setTimeout call (through some other workaround), and if that wasn’t an option I would like to know why.

I’m scared this might not be the cleanest solution for this case.

  • 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-05-27T12:07:38+00:00Added an answer on May 27, 2026 at 12:07 pm

    This is bound to be a timing issue.
    Does anything else happen on DOMContentLoaded, maybe tinyMCE or another script also runs things on that event?
    Or a script is loaded which executes a document.write()?

    Probably executing this function on load makes the issues go away.
    If that’s the case than you have to figure out whats happening at the time the problems occur, maybe do a profile session in Firebug.

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

Sidebar

Related Questions

Could anyone please tell me why the following line about filter init method invocation
I discovered a method of extending the core jQuery init function (which is what
I've the following code: $( init ); function init() { $(.Arrastrable).draggable({ stop: function(event, ui)
I have the following init method in a gen_fsm callback module (my_fsm): init(Args) when
I'm trying to create a jQuery plugin following some official best practices (function($){ var
The following method does not work because the inner block declares a variable of
The following method does not compile. Visual Studio warns An out parameter may not
The following method, when called with something like String val = getCell(SELECT col FROM
The following method is launched from the constructor of UserControl. A cross thread exception
The following method does not apply the wpf changes (background = red) until the

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.