草庐IT

nt_status_logon_failure

全部标签

javascript - Safari 扩展 : WebSocket connection failure calls onclose and not onerror and no exception

我正在为Firefox、Chrome和Safari编写浏览器扩展。当尝试使用没有服务器监听特定端口的Safari扩展连接到WebSocket服务器时,我的Safari扩展不会引发异常,也不会调用onerror。相反,正在调用Safari扩展的onclose处理程序。我还在控制台中看到此消息:[Error]WebSocketnetworkerror:Theoperationcouldn’tbecompleted.Connectionrefused(global.html,line0)在Firefox和Chrome上,它似乎可以正确处理它AFAIK并调用onerror。我只是在做这样的事情

javascript - JavaScript 中名为 "status"的变量的奇怪行为

varstatus=[true,false,true,false,true,false,true,false,true,false];varstatus1=[true,false,true,false,true,false,true,false,true,false];document.getElementById("demo1").innerHTML=status[2];document.getElementById("demo2").innerHTML=status1[2];https://jsfiddle.net/vdr2r38r/为什么具有不同名称的相同变量的行为不同?

javascript - res.should.have.status 给我错误

我是mocha和should.js的新手。我正在尝试检查响应的状态,但它给了我TypeError:Object#hasnomethod'status'代码是这样的:describe('Localsignup',function(){it('shouldreturnerrortryingtosaveduplicateusername',function(done){varprofile={email:'abcd@abcd.com',password:'Testing1234',confirmPassword:'Testing1234',firstName:'Abc',lastName:'

javascript - `jqXHR.status` 的可能值是多少?

jqXHR.status的可能值是什么?到目前为止,我可以看到以下内容:if(jqXHR.status===0){msg='NetworkProblem';}elseif(jqXHR.status==404){msg='Requestedpagenotfound.[404]';}elseif(jqXHR.status==500){msg='InternalServerError[500].';} 最佳答案 可以在这里找到任何东西。http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.ht

javascript - Websocket 错误 : Error during WebSocket handshake: No response code found in status line

我想与我的服务器建立一个tcp连接。但是我每次都会出错...WebSocketconnectionto'ws://my.ip:1337/'failed:ErrorduringWebSockethandshake:Noresponsecodefoundinstatusline:Echoserver客户:varconnection=newWebSocket('ws://my.ip:1337');connection.onopen=function(){connection.send('Ping');//Sendthemessage'Ping'totheserver};服务器:varnet=

javascript - Mocha 测试 : Uncaught TypeError: Cannot read property 'status' of null

学习TDD和我对“HelloWorld”服务器响应的第一个简单测试在Mocha中失败了。我正在使用Mocha.js、Superagent和Expect.js。当我curl-ilocalhost:8080时,我得到了正确的响应和状态代码。HTTP/1.1200OKContent-Type:text/plainDate:Mon,27Apr201517:55:36GMTConnection:keep-aliveTransfer-Encoding:chunkedHelloWorld测试代码:varrequest=require('superagent');varexpect=require('

javascript - 无法填充名为 `status` 的数组

我正在尝试做一些非常简单的事情——用Javascript初始化一个数组。它在谷歌浏览器中不起作用。这是代码:status=[];for(i=0;i什么给了? 最佳答案 status变量的分配与window.status冲突属性(property)。Chrome只是拒绝进行分配。window.status属性,设置或获取浏览器底部状态栏中的文本。我建议您要么重命名您的变量,要么使用匿名函数来创建新范围,同时记住始终使用var声明变量:(function(){varstatus=[];for(vari=0;i

javascript - Steam 发布请求 - 无法加载资源 : the server responded with a status of 400 (Bad Request)

我正在尝试发送这样的帖子请求:xhr.open("POST","/steamapi/actions/RemoveFriendAjax",false);varparams="sessionID="+session_id+"&steamid="+id;xhr.onreadystatechange=function(){//Callafunctionwhenthestatechanges.if(xhr.readyState==4&&xhr.status==200){alert(xhr.responseText);}}xhr.send(params);我正在使用Apache服务器,这是我的.h

javascript - Koa 的 `ctx.status` 没有发送给客户端

这是我的简单路线:router.post('/getFile',async(ctx)=>{constfileName=`${ctx.request.body.file}.pdf`;constfile=fs.createReadStream(fileName);//Thisfilemightnotexist.file.on('error',(err)=>{ctx.response.status=500;//Thisstatuscodedoesn'tmakeittoclientwhenthere'sanerror.});ctx.response.type='application/pdf'

javascript - Javascript POST 上的 NS_Error_Failure

我在使用某些javascript时遇到问题。下面的代码片段创建了一个简单的发布请求,但它总是抛出一个NS_Error_failure异常(页面底部有详细信息)。谁能告诉我这段代码有什么问题?window.onload=function(){alert('0');try{varurl="SomeURL";varrequest=CreateHttpRequest();if(request){alert('1');request.open("POST",url,false);request.setRequestHeader("Content-type","application/x-www-