English 中文(简体)
MooTools JSONP的请求没有用无效密码处理
原标题:MooTools JSONP request not works with invalid password

我利用MooTools提出请求。

var username =  hsz ;
var password =  pass ;
var req = new Request.JSONP({
    url:  http://api.blip.pl/profile.json ,
    method:  get ,
    headers: {
         Authorization  :  Basic   + Base64.encode(username +  :  + password),
         Accept         :  application/json ,
         Content-Type   :  application/json ,
         X-blip-api     :  0.02 
    },
    onSuccess: function(res){ alert( success ); },
    onFailure: function(res){ alert( failure ); }
}).send();

With valid login and password it works fine (alerts me success).
When I change password to an invalid value it does not do anything.
I do not know why it behaves badly.
Same thing when I use Request.JSON(). Any ideas ?

最佳回答

如果密码或用户id或两者都错的话,它不能认证/批准申请,而只是离开任何黑客!

问题回答

i 认为onFailure<>/strong>只是请求舱在XHR要求失败时发射的事件。 如果你不能认证,这并不意味着它没有向请求法院开火,只是没有取得预期结果。

页: 1 jsonp支持任择标识(执行 con平板级记录)——在班级选择中添加log:真实,并看到它试图在火力中引起哪些事件。

也可将手稿改为onComplete,并推断退回的json,以确定其根据数据取得了哪些成功(而不是Suonccess)。

在“JSONP”类中,有一笔临时财产。 违约确定为0,不触发保释。

我确定了时间范围:1,现在就开始航行。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.