Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Callback function not working

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #189173
    matthisco
    Participant

    Hello,

    I would like to fire a callback function aftey my modal has loaded.

    Can anyone please help?

    //callback function
        function fireit{
        alert("fired");
    }
    
    loadurl = function (title, page, fireit()) {
        jQuery("#dialog-default > p").load(page, null, function() {
            // fire callback after content loaded
            callback();
        });
    }
    
    #189187
    __
    Participant
    1. fireit() is calling your function, not passing it (you’re passing the result, in this case, undefined). Leave out the parens.
    2. there is no var callback in your code. you need to use the name you pass into the function (in this case, fireit).

    If you need anything more specific, please explain more and show us a codepen : )

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.