Vimeo API - Froogaloop. $f is not defined

used the api to add a button that plays 1 vimeo video on a page.

I added the Froogaloop plugin into my plugins.js file and am calling out to it on my main.js file.

Here's my code

ready = function(player_id) {
  var playButton, player;
  player = $f(player_id);
  playButton = $('#playButton');

  return playButton.on('click', function(e) {

$f(document.getElementById('player')).addEvent('ready', ready);

The problem I'm having is that any script after this will not run. The error JSHint gives me is '$f' is not defined

I've tried defining ($f = '')this, but it simply breaks the functionality (which makes sense why that would break it). Has anyone run into this issue before? Do you know of a fix?

Also note that the above code block works. It just has to be the very last thing in my main js file or else everything after it would break. It also won't pass JSHint. I get two '$f' is not defined. errors.

Any help would be greatly appreciated.




I was having this problem because I was including my script before including froogaloop.js.

It seems that $f is defined on that js.


If the error is just with JSHint, you can add the following comment to the top of the file to suppress the warning:

/*global $f:false */

You must connect the library

<script src=""></script>

As drcord pointed out in his answer to this similar question:

You are either loading jQuery after this code or not at. You need to include jQuery before this script.

<script src="></script>


Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.