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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:29:10+00:00 2026-05-26T04:29:10+00:00

So I have built a custom dialog JQuery Plugin, but am having issues with

  • 0

So I have built a custom dialog JQuery Plugin, but am having issues with the callback function.
I am trying to reload the page after the dialog closes, but my problem is the page reloads pretty much right away, so I only see the dialog for a split second, when it should actually be displayed for 5 seconds before fading away.
Any ideas what I am doing wrong? I want the message to fade out prior to the page reloading.

Here is my call to the plugin:

    $('.messages').myPlugin({
        'message' : 'Testing'
},function(){location.reload()})

And Here is the plugin script:

(function( $ ){

$.fn.myPlugin = function( options, callback ) {  
    if (typeof callback == 'function') { // make sure the callback is a function
            callback.call(this); // brings the scope to the callback
    }
    var settings = {
        //DEFAULT OPTIONS
        ...OPTIONS IN HERE....

    };
    if ( options ) { 
        $.extend(settings, options);
    };
    return this.each(function() { 
         .....BUILD THE DIALOG....
    });
    return this;//Leave this to allow chaining
};

})
( jQuery );

  • 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-26T04:29:11+00:00Added an answer on May 26, 2026 at 4:29 am

    The plugin init code calls the provided callback immediately. It’s this line:

    callback.call(this);
    

    If you still don’t understand why/how the callback is being called, use a debugger to put a breakpoint inside of the callback and step through the code — look at the call stack and it should be pretty clear.

    call stack

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

Sidebar

Related Questions

I'm trying to write a custom in-window confirm dialog (based on jQuery UI) that
I have just built a custom autocomplete component using jquery. My problem is that
I have built a custom dialog box. All the functionality is just working fine
I have built a custom Camera App and I am trying to change the
I am not using a SearchManager, but I have built my own custom search
I have built a custom membership provider that I have used in a previous
I have built a custom component using some containers and a TileList. Now when
I have a custom built ajax [div] based dynamic dropdown. I have an [input]
We have a custom-built Flash-based video player that I maintain, and it needs to
I have a custom built application framework written in PHP which I have been

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.