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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:41:50+00:00 2026-05-28T00:41:50+00:00

So since the jQuery confirm box looks awesome I figured we need to make

  • 0

So since the jQuery confirm box looks awesome I figured we need to make it actually usefull by making it possible to use it together with all other click events and inline handlers without hassles and ugly hacks like redirecting the browser url.

So I came up with this EDIT new version
jQuery confirm dialog idea to capture click events before onclick can get triggered

I figure when accessing the eventHandler of that object, it is already to late to update the inline handlers.
Or is there a way?

The code:

    $(function(){
    $(".needsFancyConfirm").each(function(index, ele){
        ele=$(ele);
        ele._onclick=ele.attr("onclick");
        ele.attr("onclick", "return false;"); //preventDefault would do the same imho

        ele.bind("click.foo",function(){
            $("#dialog").dialog({
         bgiframe: true,
         height: 300,
         modal: true,
         buttons: {
              SubmitFormWithAllOldOnclickEvents: function() {
                    $(this).dialog('close');
                 ele.attr("onclick",ele._onclick);
                  ele.unbind("click", "click.foo");
                 console.info(ele.attr('onclick') + " <-- just to make sure what is written in Onclick, now we will execute it");
                  console.info($("#coolIdea")[0].onclick() + " <-- this returns false - it should return the set old onclick e.g. alert Wow u managed to execute me");
              }
         }


         });
        });
});
});
  • 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-28T00:41:50+00:00Added an answer on May 28, 2026 at 12:41 am

    So i think this is basically a chicken and egg problem.

    At the moment we capture the event there is no way to change the eventhandlers since they were already read.

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

Sidebar

Related Questions

Edit (2012-04-12): Since this question was asked it is now possible (as of jQuery
I have a jQuery-based Style Switcher. Actually it's more like a Width Switcher since
I'm trying to use jQuery inside a Firefox extension, and actually want to use
Since regular jQuery animations are not fluent on iOS ( .hide() , slideDown() ),
I have a malfunctioning set of jquery datepickers that are only not working since
I am newbie to jQuery , just trying to learn it since last couple
I am using PJAX https://github.com/defunkt/jquery-pjax and I was wondering since the whole page does
since memcpy should be highly optimized nowadays, does it still make sense to optimize
I do NOT want to use the Jquery attachment to the field. I just
I'm having a trouble since jQuery.ajax, in this particular case, doesn't seem to happen,

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.