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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:20:04+00:00 2026-06-02T23:20:04+00:00

I am using jQuery dialog in a simple, typical use case: In the Javascript:

  • 0

I am using jQuery dialog in a simple, typical use case:

In the Javascript:

$('myDialog').dialog({
    modal: true;
});

In HTML:

<div id="myDialog" title="Dialog Title">
    Dialog contents here
</div>

However, the CSS I’m using to control the layout & look-and-feel of the myDialog div is hosted on a server that my local machine doesn’t have access to (don’t ask why). Ergo, in Firebug, I see a network 404 error of file not found for the CSS file.

When I test this dialog out locally, it displays perfectly fine. However I just noticed that the contents of the myDialog div are actually displayed on my HTML page prior to when the code that executes the dialog’s invocation is triggered.

So, this leads me to believe one of two things:

  • A jQuery dialog’s respective <div> element is invisible/hidden by default; however this weird situation where the browser can’t find the CSS file is causing the <div> to display to the user before the dialog even pops up on screen; or
  • A jQuery dialog’s respective <div> element is visible by default, and that I must take action to hide it on page load

Can someone please tell me which of those two assertions are correct?

If the former assertion is correct, then the problem should resolve itself when we push the code to our dev environment (which does have access to the CSS file).

If the latter assertion is correct, then how can I hide the myDialog div on page load?

Thanks in advance!

  • 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-02T23:20:07+00:00Added an answer on June 2, 2026 at 11:20 pm

    The second is more or less correct. When the page loads the <div> is visible because by default all <div>s in HTML are visible. jQuery only comes along for the ride later.

    You should simply make the <div> hidden by default, and let .dialog decide when to show it, for example:

    CSS:

    .hidden { display: none }
    

    HTML:

    <div id="myDialog" class="hidden" title="Dialog Title">
        Dialog contents here
    </div>
    

    If you don’t do this then things would deteriorate from “undesirable” to “unacceptable” if the dialog was not supposed to open immediately on page load. See an example.

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

Sidebar

Related Questions

I'm using the jQuery UI dialog with modal=true . In Chrome and Safari, this
I'm using this simple modal dialog example here: http://jqueryui.com/demos/dialog/modal-form.html When the page loads, jQuery
I am using the jQuery dialog widget with the modal option over a wordpress
How can I change CSS from javascript . I'm using jQuery-ui Dialog and I
Using the jquery UI Dialog, why is it that when the div that I
I'm using SimpleModal plugin ( http://www.ericmmartin.com/projects/simplemodal/ ) for generating a simple modal dialog. Now
I am trying to open a modal jquery dialog using jquery 1.4 and jquery-ui-1.8rc3.custom.js
I implemented a simple dialog form using JQuery on GAE. It works perfectly on
I'm trying to create a simple JQuery UI modal dialog populated with a loaded
Using jQuery's dialog I came across the following quirk (tested in FF3): User selects

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.