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
Post a Comment