Preview mode doesn't work when added JQuery mobile
-
Hello,
I am new to this forum and this is my first question, please help.
I have added JQuery Mobile into my child theme of Customizr. Everything works fine except the preview mode. In the preview mode, I can see the #customize-controls form on the left, but the iframe inside #customize-preview in not showing up, not even in the DOM. and I got this error in the console:
Uncaught TypeError: Object [object Object] has no method 'targetWindow'..... load-scripts.php?
This is how I add JQuery Mobile:
if (!is_admin()) add_action('wp_enqueue_scripts', array($this, 'addJQueryMobile'));
When I remove this code, the preview mode works fine. So this must be the problem.
I believe it will solve the problem if the script is not added in preview mode. I tried is_preview(), but doesn’t work :
if (!is_admin() && !is_preview()) add_action('wp_enqueue_scripts', array($this, 'addJQueryMobile'));
Any help is appreciated.
- The topic ‘Preview mode doesn't work when added JQuery mobile’ is closed to new replies.