Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7026505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:07:35+00:00 2026-05-28T00:07:35+00:00

Started messing around with Vimeo API in an attempt to create a clickable gallery

  • 0

Started messing around with Vimeo API in an attempt to create a clickable gallery like this (http://www.aideffectiveness.org/busanhlf4/vimeo/php-example.php). However, when I moved some of the code into a “script.js” file as a way to organize my code from the other parts of the site, the json callback keeps saying that the ’embedVideo’ function is not defined. Any ideas?

The “script.js” file is placed at the bottom of the page and has the following:

var NS = NS || NS;

NS = {

  videoInit: function() {

    var oEmbedUrl = 'http://vimeo.com/api/oembed.json';
    var oEmbedCallback = 'embedVideo';
    var videoid =  "";

    if(videoid == '' ){
        videoid = '23515961';
    }

    function embedVideo( video ) {
        var videoEmbedCode = video.html;
        document.getElementById('embed').innerHTML = unescape(videoEmbedCode);
    }

    function init() {
      loadScript(oEmbedUrl + '?url=http://vimeo.com/' + videoid + '&height=380&width=700&callback=' + oEmbedCallback);
    }

    function loadScript( url ) {
        var js = document.createElement('script');
        js.setAttribute('src', url);
       document.getElementsByTagName('head').item(0).appendChild(js);
    }

    init();
  }
}
$(function() {
   NS.videoInit();
});

The HTML:

<div id="wrapper">
    <div id="embed"></div>
</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:07:36+00:00Added an answer on May 28, 2026 at 12:07 am

    embedVideo is a local (private) function inside of the init method. Nothing outside it can see it. That’s why your AJAX callback is throwing that error.

    You can fix this by making embedVideo a proper method of NS, so that’s it’s visible to your ajax callback

    NS = {
      embedVideo: function( video ) {
        var videoEmbedCode = video.html;
        document.getElementById('embed').innerHTML = unescape(videoEmbedCode);
      },
    
      videoInit: function() {
    
        var oEmbedUrl = 'http://vimeo.com/api/oembed.json';
        var oEmbedCallback = 'embedVideo';
        var videoid =  "";
    
        if(videoid == '' ){
            videoid = '23515961';
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been messing around with this for some time. I recently started using the
I just started messing around with the lastfm API and I'm not sure why
ok, like an idiot, in Interface Builder i started messing around with the connections
I have finally started messing around with creating some apps that work with RESTful
I've started messing around with the DGML viewer in VS 2010 (which seems awesome).
I have started messing around with the MVVP pattern, and I am having some
I just started learning about servers, and I am messing around with Google's App
My boss was messing around with this page and suddenly it stopped working and
I've started messing around with Google App Engine, writing Python. I love Visual Studio
So I started messing around with gettext but I'm still puzzled about certain things,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.