草庐IT

access-specifier

全部标签

javascript - 缺少 CORS header 'Access-Control-Allow-Origin'

我正在尝试将webUntis(docs)API用于学校项目。现在,我只是尝试与API建立任何类型的连接。varresult;consturl='https://api.webuntis.dk/api/status';varxhr=newXMLHttpRequest();xhr.open('GET',url,true);xhr.setRequestHeader('Access-Control-Allow-Origin','*');xhr.setRequestHeader('Content-type','application/json');xhr.setRequestHeader('Ac

javascript - 尽管 header 正确,但 CORS Access-Control-Allow-Origin

我正在尝试在客户端上使用jQuery(1.7.1)驱动的ajax和apache服务的python(django)服务器来设置简单的跨源资源共享。根据我阅读过的所有说明,我的header设置正确,但我不断收到以下错误:XMLHttpRequestcannotloadhttp://myexternaldomain.com/get_data.Originhttp://localhost:8080isnotallowedbyAccess-Control-Allow-Origin.我正在尝试发送的header(我不确定它是否通过了浏览器)是:RequestURL:http://myexterna

javascript - VueJS : How to Access the Previous Item in v-repeat

我有一个表,它从LaravelAPI获取一些JSON来填充行。我正在使用VueJS和v-repeat:@{{entry.id}}@{{entry.distance}}km@{{entry.consumption}}l@{{getPrice(entry)+'€'}}@{{getCost(entry)+'€'}}@{{getAverageConsumption(entry)+'l'}}@{{getAverageCost(entry)+'€'}}@{{getCostPerDay(entry)+'€'}}@{{this.getDate(entry)}}现在我想计算AverageCostPerD

javascript - IE 中的 Ajax 请求 "Access is denied"

我使用ajax请求来检查网站的响应,如下所示,$.ajax({url:'https://www.example.com',cache:false,success:function(){alert(newDate()-start)},})它适用于我本地电脑上的所有浏览器。当我把它放在服务器上时,它可以在Chrome和Firefox中运行,但不能在IE8中运行。我收到错误:"Accessisdenied"jquery.min.js为什么会出现此错误? 最佳答案 就我而言,问题是由于兼容模式导致的。我在Intranet中,Internet

javascript - "Found @client directives in query but no client resolvers were specified"使用客户端缓存时出现警告

我一直在关注ApolloClientdocs在地方州。我实现了一个非常简单的客户端缓存查询:exportconstGET_USER_ACCOUNTS=gql`queryGetUserAccounts{userAccounts@clientname@client}`;userAccounts和name在验证后都存储在我的缓存中:{localStorage.setItem('token',token);client.writeData({data:{isLoggedIn:true,userAccounts,name:`${givenName}${familyName}`,},});}}>并

javascript - Facebook 错误 100 : You cannot specify a scheduled publish time on a published post

我只是不得不这样做。绝对每个问题我都查找了有关此问题的问题,但他们的答案都没有帮助我解决问题。我正在尝试在我的Facebook页面上发帖。问题是:错误:“(#100)您不能在已发布的帖子上指定预定的发布时间”代码:FB.api("/100177680105780/feed","POST",{"message":"Thisisatestmessage","scheduled_publish_time":Math.round(newDate().getTime()/1000)+120},function(response){console.log(response);if(response

javascript - Angular 2/4 : How to restrict access to Login Route if user is already logged in?

我有以下路线定义。exportconstRoutes=RouterModule.forChild([{path:'login',component:LoginComponent},{path:'protected',canActivate:[AuthGuardService],component:ProtectedComponent},{path:'home',component:HomeComponent,canActivate:[AuthGuardService],},]);我已成功实现AuthGuardService,如果用户未登录,它会限制对protected路由的访问。我想要

javascript - Access-Control-Allow-Origin 不允许 Origin null

我目前正在使用SoundCloudAPI,并希望在单击按钮时嵌入轨道。我得到两个错误:XMLHttpRequest无法加载http://soundcloud.com/oembed.json?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F48419073.Access-Control-Allow-Origin不允许Originnull。和未捕获的类型错误:无法读取null的属性“html”这是我的代码:+1SC.initialize({client_id:"**************",});vargetPopular=function(

javascript - Node.Js 错误 "No ' 请求中存在 Access-Control-Allow-Origin' header ”

这个问题和其他问题类似;然而,有一个区别让人很困惑为什么它不起作用。我的JavaScript调用了6个json文件并且都正常工作。在Node.JS中,我设置了cors和header,如下所示:varfs=require('fs');varhttp=require("https");varexpress=require('express');varapp=express();varpath=require('path');varhttp=require("http");varurl=require("url");varreq=require('request')varpem=requir

javascript - 错误 : Can't access lexical declaration

lettextBytes=ctypes.uint8_t("hello");leta=newSECItem;a.type=siBuffer;a.data=textBytes.address();a.len=textBytes.length;我收到ReferenceError:初始化前无法访问词法声明textBytes。 最佳答案 我无法重现你得到的引用错误,但我认为改变lettextBytes=ctypes.uint8_t("hello");因为这会抛出TypeError:expectedtypeuint8_t,got"hello"t