jquery - $.fancybox is not a function (fancybox pop up ajax response) -


i want pop ajax response fancybox, saw network section in console, response ok. getting $.fancybox not function. in advance!

$("#mysubmit").click(function(){  var myvar = { "secure_key":"41561541561561","username":$("#username").val(),"password" :$("#password").val()};  $.ajax({      type: "post",     url: "http://127.0.0.1/ajaxtest.php",     async: false,     data: myvar,     success: (function (response) {         var result =             "<div id='result'>" +             "<p>" + response + "</p>" +             "</div>";         //$.facybox not function here         $.fancybox(result, {             type: "html",         }); // show formated response       })    })  }); 

fancybox has instanciated on element.
try instanciate on jquery...

try this:

success: (function (response) {   var result =     "<div id='result'>" +     "<p>" + response + "</p>" +     "</div>";    $("body").append( $(result) );    $(document).find("#result").fancybox(); // show formated response }) 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -