1

I have uploaded a screencast of my issue as it's somewhat difficult to get across: https://www.youtube.com/watch?v=V8Gje44RGKQ

I have a list of Jquery tooltip confirms which when clicked say asks YES or NO. Pretty standard stuff...

$(document).ready(function() {
$('body').on('click', '.jConfirm', function(){
        $(this).jConfirm({ 
            message: 'You sure you to delete this?', 
            confirm: 'YUPPERS', 
            cancel: 'NO WAY!', 
            openNow: this,
            callback: function(elem){ 
                alert('According to the link you clicked...\r\nType = "'+elem.attr('itemType')+'" \r\n ID = "'+elem.attr('itemId')+'"');
            } 
        }); 
    });
});

A completely seperate thing, I have a DIV that gets populated with the following script:

    $(document).ready(function() {

        $("body").on("click",".edit", function(){

        $("#menu").load("USERS_edit.php?id="+this.value);


    });

When I click through the confirmation links, the tooltip appears and is completely functional. However, when I perform the unrelated task of loading a page into a DIV on my page, the original tooltip links do not function (apart from the ones that were already clicked).

I checked the console and I get the following error: $(...).jConfirm is not a function

Please note: The content that is being loaded into the DIV is completely seperate and does not intefer (I dont think!) with the tooltip confirmation buttons. I have stripped every single piece of code out of the file that is loaded into the DIV. I seem to have found that $("#menu").load("USERS_edit.php?id="+this.value); is causing the tooltips to stop firing, and are giving me the $(...).jConfirm is not a function message in console.

user3274489
  • 186
  • 2
  • 4
  • 15
  • Do you load the jConfirm plugin script, also in USERS_edit.php ? – SSA Oct 01 '15 at 11:50
  • http://stackoverflow.com/questions/24768624/jconfirm-is-not-defined , check if that helps – Benil Mathew Oct 01 '15 at 12:23
  • @SSA - That worked! Can someone explain why this would matter? Seen as its being loaded into a completely different DIV? - EDIT: although, now the ALERT pops up twice, and if I load more DIVS, the alert opens up as many times as as many DIVS I've loaded :S – user3274489 Oct 01 '15 at 12:51
  • jConfirm is not a function ==> I thought may be plugin was not loaded. Is it possible for you to create a jsfiddle example of the problem? – SSA Oct 01 '15 at 13:05
  • I have nailed down the issue! Strange... I think? – user3274489 Oct 01 '15 at 13:38
  • Was at the bottom of the USER_edit.php page - because I assumed I had to load Jquery again... I didn't! This was causing the issue – user3274489 Oct 01 '15 at 13:39

0 Answers0