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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:25:07+00:00 2026-05-26T03:25:07+00:00

I am trying to get the jQuery dialog box to popup up after pressing

  • 0

I am trying to get the jQuery dialog box to popup up after pressing the “upvote” link here: http://www.problemio.com

(I was working from this example, and then modified it since it didn’t work for me: http://blog.nemikor.com/2009/04/08/basic-usage-of-the-jquery-ui-dialog/ )

Here is the jQuery code I have so far which doesn’t work 🙂

<script type="text/javascript">
$(document).ready(function() 
{
   var $dialog = $('.dialog')
           .dialog({
               autoOpen: false,
               title: 'Basic Dialog'
           });   

    $('.vote_up').click(function() 
    {        
        problem_id = $(this).attr("data-problem_id");

        var dataString = 'problem_id='+ problem_id + '&vote=+';

        $.ajax({
                type: "POST",
                url: "/problems/vote.php",
                dataType: "json",
                data: dataString,
                success: function(data)
                {           
                    // ? :)
                    alert (data);   
                },
                error : function(data) 
                {
                    //alert("ajax error, json: " + data.responseText);
                    errorMessage = data.responseText;

                    if ( errorMessage == "not_logged_in" )
                    {
                        alert ("errr");

                        // Try to create the popup that asks user to log in.
                        //$(this).dialog();
                        //$(".dialog").dialog();
                        $dialog.dialog('open');
                        // prevent the default action, e.g., following a link
                        return false;
                    }
                    else
                    {
                        alert ("not");
                    }

                    //alert(JSON.stringify(data));
                }
            });


        //Return false to prevent page navigation
        return false;
    });

    $('.vote_down').click(function() 
    {
        alert("down");

        problem_id = $(this).attr("data-problem_id");

        var dataString = 'problem_id='+ problem_id + '&vote=-';        

        //Return false to prevent page navigation
        return false;
    });    
});
</script>

Above this code I have another jQuery function that also has a documentOnready check. Would that matter? Should I make the dialog box code global? If so, how do I do that?

In any case, how can I get the dialog box to open for me with the setup I have now?

Thanks!!

Changed my jQuery imports to this:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.16/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js" />
  • 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-26T03:25:08+00:00Added an answer on May 26, 2026 at 3:25 am

    Change this (at the top within your $(document).ready()):

       var $dialog = $('.dialog')
               .dialog({
                   autoOpen: false,
                   title: 'Basic Dialog'
               }); 
    

    to

       var $dialog = $('.dialog');
       $dialog.dialog({
                   autoOpen: false,
                   title: 'Basic Dialog'
               }); 
    

    And it is okay to have multiple $(document).ready(), they all should run once the dom is loaded

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

Sidebar

Related Questions

I am trying to get the Jquery UI modal dialog to take over after
i am trying to get asmSelect, which works fine on its own: http://www.ryancramer.com/projects/asmselect/examples/example1.html but
I'm trying to get a rich text editor in a jquery dialog box. I'm
I've been trying to figure out how to get a jquery dialog box to
I'm trying to get the jQuery Mobile events( https://github.com/jquery/jquery-mobile/blob/master/js/jquery.mobile.event.js ) to work as a
I am trying to show the street view in a jquery dialog box with
I am trying to get a simple jQuery UI dialog to work in an
I'm trying to use Backbone.js to in a JQuery Dialog. I've managed to get
I'm trying to click a link & put that text into a jquery dialog
I'm trying to get a simpleDialog box to open up via a link using

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.