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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:09:21+00:00 2026-06-13T19:09:21+00:00

I have a jQuery dialog, and I use the open callback to load some

  • 0

I have a jQuery dialog, and I use the open callback to load some data into via AJAX.

For example:

$('#dialog').dialog({
    modal: true,
    autoOpen: false,
    open: function(){
        $('.content', this).load('/path/to/file', function(){
            // even more code
        });
        // more code
    }
});

While the dialog is already open, I want to re-load the data via AJAX. I figured that I could just trigger the open function I bound above. I read in the docs that you can bind to that open event using $(".selector").bind("dialogopen", function(event, ui){}), so I figured I could trigger the event that way too.

I tried $('#dialog').trigger('dialogopen'), but nothing happened. How can I trigger the open event of a jQuery dialog?

Currently, I figured out that I could use $('#dialog').dialog('option', 'open')(), but that’s ugly, there’s gotta be a better way!

  • 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-13T19:09:22+00:00Added an answer on June 13, 2026 at 7:09 pm

    why dont you just extract the function in the open event and reuse it wherever you want to?

    $('#dialog').dialog({
        modal: true,
        autoOpen: false,
        open: function(){
            loadfunction()
        }
    });
    
    function loadfunction(){
      $('.content').load('/path/to/file', function(){
                // even more code
            });
            // more code
    }
    

    so you can use the loadfunction everywhere you want to.

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

Sidebar

Related Questions

I use jquery ui tabs with conten via Ajax. In content1.html have a dialog
I am creating a JQuery dialog where I have use data from a Model
I have a JQuery UI modal: $('#avatar-manager').click(function () { $('#dialog').dialog('open'); return false; }); $('#dialog').dialog({
I have a jquery dialog as follows - <div data-role=dialog id=msg-popup> <div data-role=header> <h1>Notification</h1>
I have a jquery modal dialog that displays a partial view. The partial view
I have project that shows few tables and try to use JQuery dialog boxes
I have a JSf form, I am tryin' to use jQuery Ui dialog plugin
i have a jquery Dialog in a partial view: @model JQueryDialogPoc.Models.FeedBack @using (Ajax.BeginForm(GiveFeedback, Home,
I am using a jquery modal dialog to display a table of data from
I'm trying to load a jsp-file into a jQuery UI dialog http://jqueryui.com/demos/dialog/ . 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.