Note that there are some explanatory texts on larger screens.

plurals
  1. POcustom fancyBox displaying SyntaxError and TypeError in live deployment, works locally
    primarykey
    data
    text
    <p>I'm testing fancyBox for the first time and I've run into a hurdle.</p> <p>Following instructions on the developers <a href="http://fancyapps.com/fancybox/" rel="nofollow noreferrer">website</a> I've played around with the options you can pass to the fancybox() method so that only the primary image is displayed, and it retrieves information from an element rather than an attribute tag.</p> <p>It works perfectly locally, as can be seen here: </p> <p><img src="https://i.stack.imgur.com/ceE92.jpg" alt=""> </p> <p><br><br> But the same can't be said when I went live as you'll painfully see <a href="http://www.universalphysique.co.uk/about.php" rel="nofollow noreferrer"><strong><em>here.</em></strong></a></p> <p>Chrome's JS console is saying the following:</p> <pre><code>Uncaught SyntaxError: Unexpected token &lt; jquery.fancybox.js:3 Uncaught SyntaxError: Unexpected token &lt; jquery.fancybox-thumbs.js:3 Uncaught TypeError: Object [object Object] has no method 'fancybox' about.php:302 (anonymous function) about.php:302 c jquery.js:3074 p.fireWith jquery.js:3186 x.extend.ready jquery.js:433 q jquery.js:104 </code></pre> <p>The unexpected token is apparently from <code>&lt;!DOCTYPE html&gt;</code></p> <p>I feel it's down to my script arrangement, or lack of...... </p> <p>My current arrangement:</p> <p><strong>Header</strong></p> <pre><code>&lt;link rel="stylesheet" href="fancybox/source/fancybox.css" type="text/css" media="screen" /&gt; &lt;link rel="stylesheet" href="fancybox/source/fancybox-thumbs.css" type="text/css" media="screen" /&gt; </code></pre> <p><strong>Body</strong></p> <pre><code> &lt;figure class="col-8 img-wrapper"&gt; &lt;a class="fancybox fancybox-thumb" data-title-id="title-1" href="img/gym-01.jpg"&gt;&lt;img class="img" src="img/gym-01.jpg" alt=""/&gt;&lt;/a&gt; &lt;div id="title-1" class="hidden"&gt; This is 1st title. &lt;a href="http://google.com"&gt;Some link&lt;/a&gt; &lt;/div&gt; &lt;/figure&gt; &lt;div class="hidden"&gt; &lt;a class="fancybox fancybox-thumb" data-title-id="title-2" href="img/gym-02.jpg"&gt;&lt;img src="img/gym-02.jpg" alt=""/&gt;&lt;/a&gt; &lt;div id="title-2" class="hidden"&gt; This is &lt;b&gt;2nd title&lt;/b&gt;. &lt;a href="http://google.com"&gt;Some link&lt;/a&gt; &lt;/div&gt; &lt;a class="fancybox fancybox-thumb" data-title-id="title-2" href="img/gym-03.jpg"&gt;&lt;img src="img/gym-03.jpg" alt=""/&gt;&lt;/a&gt; &lt;div id="title-3" class="hidden"&gt; This is &lt;b&gt;3rd title&lt;/b&gt;. &lt;a href="http://google.com"&gt;Some link&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p><strong>Footer</strong></p> <pre><code>&lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="fancybox/source/fancybox.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="fancybox/source/fancybox-thumbs.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="js/script.js"&gt;&lt;/script&gt; </code></pre> <p>script.js contains my custom fancyBox options.</p> <p>Is it something daft that I'm missing????</p> <p>Cheers guys!!</p> <p>EDIT: It was simply an issue with the source path</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload