Note that there are some explanatory texts on larger screens.

plurals
  1. POTypeError (or, alternately, ReferenceError) when using JQuery UI with WordPress
    primarykey
    data
    text
    <p>I'm working on an interface for <code>&lt;audio&gt;</code>, and I'm working with JQuery UI's slider to provide the seek and volume functionality.</p> <p>I actually have an ugly little mockup of it which works just fine; I've posted it <a href="http://jameskallembach.com/jamesscripts/audio-controls.html" rel="nofollow noreferrer">here</a>. (If you fiddle with it, you'll want to interact with "Instance 2," which links to sources elsewhere on the web. "Instance 1" refers to source files in the same directory as the html document, and I haven't uploaded those.)</p> <p>The problem comes when I try to implement this (slightly modified) within a WordPress site. The script itself is all taken care of <a href="http://jameskallembach.com/jamesscripts/jamesPlayerMini.js" rel="nofollow noreferrer">here,</a> and the result shows up (or fails to, as the case may be) at <code>http://www.jameskallembach.com</code>.</p> <p>In its current form, an error pops up in the Chrome dev tools at line 155 of <code>jamesPlayerMini.js</code> proclaiming <code>Uncaught TypeError: Object [object Object] has no method 'slider'</code>. However, this is only one of the errors I can produce with just a few simple tweaks; if I:</p> <ul> <li>Remove the comment marks around lines 20-61, I get <code>Uncaught TypeError: Cannot read property 'slider' of undefined</code> at line 21; and</li> <li>If I also comment out lines 19 &amp; 202, which place the offending passages under <code>window.onload</code>, I get <code>Uncaught ReferenceError: $ is not defined</code> on line 21.</li> </ul> <p>In both of those casses the script stops working altogether at the line 21.</p> <p>The explanation I would expect for these errors would be that JQuery and JQuery UI weren't present when called for, but I would have thought I'd solved that problem by adding them as the first and second children, respectively, of <code>&lt;head&gt;</code>. I basically have no idea what's going on, and enlightenment would be deeply appreciated.</p> <p><strong>Update:</strong> I took a look at <a href="https://stackoverflow.com/questions/8272939/uncaught-typeerror-with-jquery-and-wordpress?rq=1">Uncaught TypeError with jQuery and Wordpress?</a>, and wrapping the window.onload=function(){ in jQuery(function($) { }); seems to have solved some of the problems, but if I uncomment lines 20-61, we're back in error land.</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.
 

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