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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:24:51+00:00 2026-06-03T00:24:51+00:00

Is it possible to have a link in the jquery dialog box which calls

  • 0

Is it possible to have a link in the jquery dialog box which calls a javascript function? something like this –

var msg-dialog = $('#dialog-msg');
msg-dialog .html("Please click < a href='javascript:void(0)' onclick='javascript:reload();'>here</a> to reload.");
msg-dialog('open');

 function reload() {
      // do something.
      alert('test');
    }

The link shows up in the dialog just fine but clicking it doesn’t do anything. What am I missing? I also want to close the dialog in the function.

  • 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-03T00:24:52+00:00Added an answer on June 3, 2026 at 12:24 am

    Assuming you have the appropriate libraries, this will work right out of the box:

    <html>
    <head>
    <link href="jqueryUI/css/ui-lightness/jquery-ui-1.8.19.custom.css" rel="stylesheet" type="text/css">
    <script src="jquery-1.7.1.js"></script>
    <script src="jqueryUI/js/jquery-ui-1.8.19.custom.min.js"></script>
    
    <script type="text/javascript">
    function doSomething() {
        $('#dialog').dialog('close');
    }
    
    $(document).ready(function() {
        $("#dialog").dialog();
        $("#dialog").html("<a href=\"#\" onclick=\"doSomething();\">Call doSomething() function!</a>");
    });
    </script>
    
    </head>
    <body>
    <div id="dialog"></div>
    
    </body>
    
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to have a link/button that will execute an AJAX/Jquery function to
I have an anchor like <a href=/category/post/?type=234#content>link</a>. Using a jQuery is it possible to
I have some elements like <a class='link'>click</a> which are created after clicking on another
i have a html link that i want to popup a dialog box with
Using jquery dialog I have created a popup box with a form. I am
I have a link to delete action using Jquery dialog confirm message. Clicking on
I have a link that create a dialog with jquery mobile in my page
I have an asp:LinkButton which require following - - call jQuery to open link
I am somewhat new to jquery and have no idea if this is possible,
I have a jQuery tip function. I would like to create a button to

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.