Response from Vimeo's AJAX API

I am having trouble retrieving the AJAX response from Vimeo to extract a thumbnail without using JQuery. Even though I can see the response data in JSON format when I type the response query (http://vimeo.com/api/v2/video/30408418.json) into the browser and download the file, my code is not receiving the response.

After trying the same request on a page where Flickr responses were working with jQuery and still getting an empty response, I believe it is not a JSONP issue.

var vimeoVid= {};
var request = getHTTPObject();
if(request){
    var requString="http://vimeo.com/api/v2/video/30408418.json";
    request.open('GET',requString,true);
    request.onreadystatechange=function(){
        if(request.readyState==4){
        vimeoVid = JSON.parse(request.responseText);
        }
    };
    request.send();
    }
    else
    {
    alert('Sorry, your browser doesn\'t support XMLHttpRequest');
    }
    console.log("vimeoVid");

Here is the function used:

function getHTTPObject(){
if(typeof XMLHttpRequest == "undefined")

XMLHttpRequest=function(){
try{return new ActiveXObject("Msxml2.HHHTP.6.0");}
catch(e){}

try{return new ActiveXObject("Msxml2.XMLHTTP.3.0");}
catch(e){}
try{return new ActiveXObject
("Msxml2.XMLHTTP");}
catch(e){}
return false;
}
return new XMLHttpRequest();
}

Answer №1

When dealing with AJAX across different domains, there are limitations (except for modern browsers and in cases where it's specifically allowed). In such situations, the use of JSONP is necessary.

For instance, you can refer to this URL:

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

unable to apply angular measurement inside quotation marks

What is the reason for this issue: <ul class="dropdown-menu"> <li ng-repeat="choice in dropDownItems"> <a class="btn" ng-click="mnuClick('{{choice}}')">{{choice}}</a> </li> </ul> However, this code wo ...

Troubleshooting error handling in Node.js using Express and MongoDB

hey there, I'm new to Node.js and I'm working on creating a basic notes app using express and MongoDB. However, I'm encountering an issue when trying to update a note which displays "Cannot PUT" followed by the note's ID. Below is the ...

The moment I attempted to send a POST method through AJAX, I encountered a 404 error. This issue occurred despite using both

I am working with Spring MVC and attempting to integrate jQuery into my project. The following code snippet is part of my web page setup: $(document).ready(function () { var entity = {mag: "status_key", paper: "View10"}; $("#btn").click(function ( ...

Retrieving information from a JSON source to populate a data table

Hello fellow developers... I'm currently facing an issue while trying to dynamically populate a data table with information fetched through a fetch request and stored in a Vuex instance variable. Here is the relevant code snippet: <script> impo ...

Apollo client combines objects when the 'id' property is not specified

When I query data from my Apollo server, it follows a specific structure as shown below: hero { image { id name mimeType url } title description } welcome { image { id name mimeType ...

The clear function in the template slot of Vue multiselect is not functioning properly

I decided to incorporate the asynchronous select feature found in the documentation for my project. This feature allows me to easily remove a selected value by clicking on 'X'. Below is a snippet of the general component that I use across variou ...

What steps do I need to take to create a custom image for a website?

I'm looking for a way to create a website image using just code, without the need for an actual image file or image tag. Is there a method to do this? Would I use CSS, Javascript, or HTML5 for this task? If using JavaScript to dynamically generate the ...

What is the best way to arrange an array in either javascript or typescript based on a specific key, and in the case of identical keys,

Below is an array with objects that need to be sorted: [ { "Books": [], "_id": "5dea9a11a8e1bf301c462ce4", "FileName": "AAAAA", "Order": 99999 }, { "_id": "5dea9864a8e1bf301c462cdb", "Books": [], "FileName": "some1", ...

Adding content into a designated position in a document

My challenge is to find the index of user-provided data in order to insert new data at that specific point. I am familiar with array insertion methods, but extracting the index provided by the user is where I'm stuck. My current approach involves filt ...

Showcasing a JSON attribute in the title using AngularJS

I'm struggling to display the Title of a table. Here is where I click to open a "modal" with the details: <td><a href="#" ng-click="show_project(z.project_id)">{{z.project}}</a></td> This is the modal that opens up with det ...

A blank Post request is received by AJAX and Spring Boot

Within the front end section, this code snippet is present: $("#add_button").click(function() { console.log("The button has been pressed"); var genre = { name: $("#genre_name").val(), description: $(&qu ...

Modifying React routes does not alter the path or outlet of the routes

On the app.js file, I have the following routes: import React from "react"; import Login from "./pages/Login"; import { BrowserRouter, Routes, Route } from "react-router-dom"; import Dashboard from "./pages/Dashboard" ...

How can we enhance the backbone sync feature by appending a query string to the URL?

I am facing an issue with adding a token to the backbone URL query string and I am seeking assistance from you all. Here are three important things to note: There is a REST API that requires a token for each request An NGINX backend handles authenticatio ...

The google analytics tag is failing to function properly after implementing ajax on the

I am currently utilizing Google Analytics to track all events on my website. I have noticed that when the gtag scripts are directly embedded into the HTML, everything works perfectly fine (I always verify the events in Google Analytics). However, after i ...

"Utilizing Vue.js to determine whether a checkbox is filled with data or left

My goal is to create a checkbox using vue js without writing a method. I want the checkbox to default to false, and when checked, I want the data "opening_balance" to be an empty array. Conversely, if the checkbox is unchecked, I want it to be omitted when ...

What is causing my Javascript media query for the sidebar to not function properly?

I am working on implementing a sidebar that slides out 250px using JavaScript on the desktop view. However, I want the sidebar to take up 100% width when viewed on mobile devices. Despite my attempts to use Media Queries in JavaScript to achieve this, I am ...

"Despite successfully clicking on the menu with Selenium WebDriver, no action or change occurs on the webpage

Currently, I am in the process of writing a selenium C# test script for an older "infragistics" webpage, which I must admit, is not something I am very familiar with. The challenge I am facing is that the page does not provide many options for referencing ...

What is the best way to handle multiple axios calls with pagination in a React application?

Discussing React Pagination and Handling Multiple Axios Calls In my current project, I am faced with the challenge of mapping through an array of numbers and making sequential API calls for each one. The API I'm working with returns paginated results ...

Error message: "Issue encountered with locating Node import module while operating within a docker

I've created a React app along with a Node.js server that includes the following imports: import express from 'express' import compression from 'compression' import cookieParser from 'cookie-parser' import bodyParser from ...

What is the method for defining functions that accept two different object types in Typescript?

After encountering the same issue multiple times, I've decided it's time to address it: How can functions that accept two different object types be defined in Typescript? I've referred to https://www.typescriptlang.org/docs/handbook/unions ...