fancybox-related jquery error: Uncaught ReferenceError: ...is not defined
Fancybox glitch. When a link on a particular page is clicked, this gravity forms fancybox pop up window should apppear (as it does on all other pages). But on one page, instead I see just the ajax waiting circle appear and then disappear with the following error showing up in google chrome "inspect element" window:
-
ReferenceError: gformInitDatepicker is not defined
This is what appears to be the relevant fancybox functions.php code:
----
- <script type='text/javascript'>
- function ajax_shortcode_run_<?php echo $devl_ajaxshid?>(){
- jQuery.fancybox.showActivity();
- jQuery.post('<?php echo get_permalink($post->ID)?>',{sc_ajax:1,action:'ajax_shortcode',post_id:<?php echo $post->ID?>,nonce:'<?php echo $devl_scajax_nonce?>',shortcode:"<?php echo addcslashes ($c,'"')?>"},function(resp){
- jQuery('#ajaxsh_<?php echo $devl_ajaxshid;?>_cnt').html(resp).find('div.gform_wrapper').css('display','block');
- // jQuery.fancybox.resize();
- var zi=jQuery('#ajaxsh_<?php echo $devl_ajaxshid;?>').fancybox().css("z-index");
- jQuery.fancybox.hideActivity();
- gformInitDatepicker();
- jQuery('#ajaxsh_<?php echo $devl_ajaxshid;?>').trigger('click');
- jQuery('#ui-datepicker-div').css("z-index",Number(jQuery('#fancybox-content').css("z-index"))+10);
- // jQuery.triggerReady();
- });
- return false;
- }
- </script>