{"id":1718,"date":"2022-08-30T15:18:52","date_gmt":"2022-08-30T15:18:52","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/29\/after-closing-fancybox-2-modal-jquery-fn-xxxx-method-can-not-be-found-anymore-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:18:52","modified_gmt":"2022-08-30T15:18:52","slug":"after-closing-fancybox-2-modal-jquery-fn-xxxx-method-can-not-be-found-anymore-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/after-closing-fancybox-2-modal-jquery-fn-xxxx-method-can-not-be-found-anymore-collection-of-common-programming-errors\/","title":{"rendered":"After closing Fancybox 2 modal jQuery.fn.xxxx method can not be found anymore-Collection of common programming errors"},"content":{"rendered":"<p>Here is the deal,<\/p>\n<p>I am using the following:<\/p>\n<ol>\n<li>jQuery latest version (today is: May 16 2012);<\/li>\n<li>Fancybox version 2 jQuery plugin<\/li>\n<li>*.js file that contains all my jQuery [clicks, hover, change&#8230;.] built-in functions and jQuery.fn.xxxx self-made functions;<\/li>\n<li>I am running my website on CakePHP 2.1.2 (localhost)<\/li>\n<\/ol>\n<p>I created two jQuery functions:<\/p>\n<ol>\n<li>jQuery.fn.myFunction1 (check all checkboxes on the page); and<\/li>\n<li>jQuery.fn.MyFunction2 (uncheck all checkboxes on the page)<\/li>\n<\/ol>\n<p>which works as expected before I click on this link shown below that is linked to my javascript file.<\/p>\n<pre><code>Click here\n<\/code><\/pre>\n<p>linked to:<\/p>\n<pre><code>    $(\".group\").fancybox({\n    maxWidth    : 800,\n    maxHeight   : 600,\n    fitToView   : false,\n    width       : '70%',\n    height      : '70%',\n    autoSize    : true,\n    fitToView   : true,\n    type        : 'ajax',\n    closeClick  : false,\n    openEffect  : 'fade',\n    closeEffect : 'fade'    \n});\n<\/code><\/pre>\n<p>After I close the modal (by clicking on the [x] image above that comes with the plugin) back and try to trigger the two functions jQuery.fn.myFunction1 and &#8230;Function2 again, they can not be found anymore! Really weird.<\/p>\n<p>The console error is: Uncaught TypeError: Object [object Object] has no method &#8216;myFunction1&#8217;<\/p>\n<p>Just for the record: All my *.js files are intact, they are properly connected with the page. Every other .click(function(){}); (change, dblClick, hover, &#8230;) works as expected, also the page is not being refreshed to another page or website. It&#8217;s on the same page prior to opening the modal. But again these two functions (jQuery.fn.myFunction1 and jQuery.fn.myFunction2) can not be found anymore.<\/p>\n<p>Does anyone know what the problem here is?&#8230;Is this a bug on jQuery side or Fancybox 2 side? The most important question, how can I fix this? \ud83d\ude42<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-29 06:17:27. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>Here is the deal, I am using the following: jQuery latest version (today is: May 16 2012); Fancybox version 2 jQuery plugin *.js file that contains all my jQuery [clicks, hover, change&#8230;.] built-in functions and jQuery.fn.xxxx self-made functions; I am running my website on CakePHP 2.1.2 (localhost) I created two jQuery functions: jQuery.fn.myFunction1 (check all [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1718","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1718","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1718"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1718\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1718"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1718"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1718"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}