Home > other >  jquery function is not called but parent function is, not sure why
jquery function is not called but parent function is, not sure why

Time:12-27

I'm building something with fullcallendar and I'm testing out my eventclick

when I press the item on screen I see "eventClick called" in console BUT not "getScript called" . what am I missing?

            eventClick: function(event, jsEvent, view) {//EDIT
                console.log("eventClick called")
                $.getScript(event.edit_url, function() {
                    console.log("getScript called");
                });
            },

Thank you for your time

CodePudding user response:

From the documentation:

The second argument to getScript is:

A callback function that is executed if the request succeeds.

If it doesn't get called, then the request didn't succeed.

Either the click which triggered it had a side effect (such as navigating to a new page) that cancelled the request or something else went wrong (such as a network error or the URL not returning a script).

These last two options can both be debugged in the Network tab of the developer tools (which will show you the HTTP response status, content-type, and the response body.

  • Related