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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:33:14+00:00 2026-06-08T22:33:14+00:00

i am using smoke.js which allows to style the classic alert javascript windows. All

  • 0

i am using smoke.js which allows to style the classic alert javascript windows.

All you have to do is place .smoke before the alert ie. smoke.confirm()

The issue I am having is with the ok/cancel callback, it isnt working for me.

This is the example the website shows.

`You can implement these the same way you’d use the js alert()…just put “smoke.” in front of it.

The confirm() replacement, however, needs to be used just a little differently:

smoke.confirm('You are about to destroy everything. Are you sure?',function(e){
    if (e){
        smoke.alert('OK pressed');
    }else{
        smoke.alert('CANCEL pressed');
    }
});

and the code I have is;

$(".upb_del_bookmark").click( function() {
        if(smoke.confirm(delete_message)) {
            var post_id = $(this).attr('rel');
            var data = {
                action: 'del_bookmark',
                del_post_id: post_id
            };
            $.post(upb_vars.ajaxurl, data, function(response) {
                $('.bookmark-'+post_id).fadeOut();
                $('.upb_bookmark_control_'+post_id).toggle();
            });

It shows the style button and everything but when i click on OK it doesnt perform the function above, nothing happens.

Confirm

So i rewrote it to

$(".upb_del_bookmark").click( function() {
        if(smoke.confirm(delete_message, function(e))) {
            if(e){
            var post_id = $(this).attr('rel');
            var data = {
                action: 'del_bookmark',
                del_post_id: post_id
            };
            $.post(upb_vars.ajaxurl, data, function(response) {
                $('.bookmark-'+post_id).fadeOut();
                $('.upb_bookmark_control_'+post_id).toggle();
            });
        }}

But now when i click it doesnt even show anything

I am not a programmer, Help!!!!!

If you want to try it go to latinunit.org login with david:123321 and then go to a post and try to add it to your favourites

Update

I tried the following, it shows the window but it doesnt perform the function;

$(".upb_del_bookmark").click( function() {
        smoke.confirm(delete_message, function(e) {
            if(e){
            var post_id = $(this).attr('rel');
            var data = {
                action: 'del_bookmark',
                del_post_id: post_id
            };
            $.post(upb_vars.ajaxurl, data, function(response) {
                $('.bookmark-'+post_id).fadeOut();
                $('.upb_bookmark_control_'+post_id).toggle();
            });
        }})
        return false;
    });

Here is the js file of the smoke script Link

When i click on cancel the following shows;

Uncaught TypeError: Property ‘callback’ of object # is not a
function Line:198
Uncaught TypeError: Property ‘callback’ of object # is not a
function Line:208

The following is what’s on those linesof the smoke script;

finishbuildConfirm: function (e, f, box)
    {
        smoke.listen(
            document.getElementById('confirm-cancel-' + f.newid),
            "click", 
            function () 
            {
                smoke.destroy(f.type, f.newid);
                f.callback(false);
            }
        );

        smoke.listen(
            document.getElementById('confirm-ok-' + f.newid),
            "click", 
            function () 
            {
                smoke.destroy(f.type, f.newid);
                f.callback(true);
            }
        );
  • 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-08T22:33:18+00:00Added an answer on June 8, 2026 at 10:33 pm

    The builtin javascript alert/confirm functions are synchronous, this is not. You need to handle the result of the confirm using the javascript callback pattern. You pass a function to the smoke.confirm() function which called when you need to respond to an action.

    See the following code. The if around the smoke.confirm() has been removed and the handling code is wrapped in the function passed to the smoke.confirm() function.

    $(".upb_del_bookmark").click( function() {
        smoke.confirm(delete_message, function(e) {
            if(e){
                var post_id = $(this).attr('rel');
                var data = {
                    action: 'del_bookmark',
                    del_post_id: post_id
                };
                $.post(upb_vars.ajaxurl, data, function(response) {
                    $('.bookmark-'+post_id).fadeOut();
                    $('.upb_bookmark_control_'+post_id).toggle();
                });
            }
        });
    }
    

    I highly recommend reading a little about the callback pattern in javascript. It’s very common and understanding it will help you use this plugin and many others.

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

Sidebar

Related Questions

Using the Redis info command, I am able to get all the stats of
I'm making a particle system for my game, which basically is smoke coming out
I am implementing some smoke tests to our website. I'm using a Given/When/Then format
We have been developing a hub/spoke synchronization model using Microsoft Sync Framework and WCF,
I have report that I must convert to PDF using xsl-fo from xml data
When I have a UIBezier and I stoke it on a view using drawRect
I am using the serialize() function to grab all fields in a form. In
I am in the process of designing a web application which will have multiple
I have the following JQuery code which does similar functionality like Stackoverflow where the
I am using XNA my rocket is creating smoke objects when it fly. I

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.