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

  • Home
  • SEARCH
  • 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 7177843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:47:57+00:00 2026-05-28T16:47:57+00:00

Take a look at this jsfiddle . I’ve used the jQuery dialogs before and

  • 0

Take a look at this jsfiddle. I’ve used the jQuery dialogs before and this is the exact same code that I’m using in another project. The only difference is that I’m getting the jQuery libraries from google instead of hosting them myself:

<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js">  </script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js">  </script>


<div id="dialog-confirm" title="Confirmation Required" > 
            <p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>Do you want to delete?</p> 
        </div>
<a href="http://google.com" class="deleteLink">Test Dialog</test>

Then I have a script like this:

 $(document).ready( function () {
$("#dialog-confirm").dialog({
  autoOpen: false,
  modal: true,
  resizable: false,
  height:180,
});

$(".deleteLink").click(function(e) {
e.preventDefault();
var targetUrl = $(this).attr("href");

$("#dialog-confirm").dialog({
    buttons : {
    "Confirm" : function() {
        window.location.href = targetUrl;
    },
    "Cancel" : function() {
        $(this).dialog("close");
    }
    }
});

$("#dialog-confirm").dialog("open");
});

} );

The dialog shows up as expected but the buttons (Confirm/Cancel) do not show up. I think I’m loading all the relevant jQuery libraries and the CSS file. Is there something else I’m missing?

I’ve used FireBug to verify that it does call the button setting code, but still no buttons.

  • 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-28T16:47:58+00:00Added an answer on May 28, 2026 at 4:47 pm

    the reason your code may not be working now could be due to you using an older version of jQuery or jQuery UI either way here is a possible fix:

    $(document).ready( function () {
    var targetUrl;
    $("#dialog-confirm").dialog({
      autoOpen: false,
      modal: true,
      resizable: false,
      height:180,
      buttons: {
        "Confirm" : function() {
            window.location.href = targetUrl;
        },
        "Cancel" : function() {
            $(this).dialog("close");
        }
        }
    });
    
    $(".deleteLink").click(function(e) {
    e.preventDefault();
    targetUrl = $(this).attr("href")    
    $("#dialog-confirm").dialog("open");
    });
    });
    

    the buttons should be assigned when you create the .dialog function, to still be able to pass the URL when the button is clicked I created the targetURL globally, then you can assign it in the click function and still access it in the dialog function

    **sorry forgot to move the link to make it work 🙂 should be fine now, also here is a link to the fiddle, the linking action doesnt seem to work in fiddle but I tested it with an alert and it is passing ok: http://jsfiddle.net/GordnFreeman/wbGax/

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

Sidebar

Related Questions

Please take a look at this simple code: http://jsfiddle.net/kerp3/ The box has an inner
take a look of this: http://jsfiddle.net/PFQke/ I want to add some icons to that
If you'll take a look at this: http://jsfiddle.net/hunterscott/JYLVQ/ You'll notice that if you try
take a look at this example code: public class Comment { private Comment() {
Take a look at this code: public class Test { public static void main(String...
take a look at this code: $(document).ready(function() { document.getElementById(sliderId).onmousedown = sliderMouseDown; }); function sliderMouseDown()
Take a look at this snazy plugin: http://remysharp.com/2007/12/28/jquery-tag-suggestion/ ** it's real small Source: http://remysharp.com/downloads/tag.js
Please take a look at this example: #include <iostream> #include <vector> #include <string> using
Could someone possibly take a look at this: http://jsfiddle.net/VkFRU/4/ and explain the console output
Well Im stucked at this point.please take a look at this http://jsfiddle.net/karthik64/5jhgF/3/ Okay first

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.