小编Bog*_*Biv的帖子

在HTTP CORS规范中,Allow-Headers和Expose-Headers之间的区别是什么?

在HTTP CORS规范中,5.6 Access-Control-Allow-Headers5.3 Access-Control-Expose-Headers之间的区别是什么?

[Allow-Headers]标头指示,作为对预检请求的响应的一部分,在实际请求期间可以使用哪些标题字段名称

UPDATE:我希望有人能告诉我这些头之一为每个请求(飞行前)发送......但是,尚未被用于另一头:5.9的访问控制请求报头

[Request-Headers]标头指示在实际请求中将使用哪些标头作为预检请求的一部分

顺便说一句,我喜欢他们(W3C)如何谨慎地说出5.9,以便请求标题可以有一个字段_Something_ Request Header.

我完全迷失在规范中,是否有一个图表,我可以更好地理解这个过程?

http cors

19
推荐指数
2
解决办法
6314
查看次数

构建BackboneJS事件集合时出错 - 新的Event()抛出错误

这似乎是一个集合的标准用法,但它不起作用.我在文档就绪函数中有以下代码:

$(function() {
  window.EventList = Backbone.Collection.extend({
    model: Event,
    url: '/events',
        parse: function(response) { // same result with or without parse function
      return _(response.rows).map(function(row) { return row.doc ;});
    }
  });         
  window.Events = new EventList;
  // throws Uncaught TypeError: Illegal constructor
  // Events.fetch();
});
Run Code Online (Sandbox Code Playgroud)

我已经使用Chromium和Firefox进行了测试,FF更加冗长:

this.model is not a constructor at Backbone.js line:570
[Break On This Error] model = new this.model(attrs, {collection: this}); 
Run Code Online (Sandbox Code Playgroud)

我错过了什么?

作为旁注,如果您需要更多上下文,我正在尝试关注Chris Storm的教程/链.

相关软件版本:

  • jQuery JavaScript Library v1.7.1
  • Backbone.js 0.5.3
  • Underscore.js 1.2.2
  • Chromium 14.0.835.202(Developer Build 103287 Linux)Ubuntu …

javascript backbone.js backbone-events

3
推荐指数
1
解决办法
1750
查看次数

在Intern中加载Leadfoot模块会产生错误

Leadfoot作为Intern框架(./node_modules/intern/node_modules/leadfoot)的一部分安装.但是,当我尝试在文档中使用它时(https://theintern.github.io/leadfoot/pollUntil.html):

define([
    'intern!object',
    'intern/chai!assert',
    'require'
], function (registerSuite, assert, require) {
    var url = '../../index.html';
    var Command = require('leadfoot/Command');
    var pollUntil = require('leadfoot/helpers/pollUntil');

    registerSuite({
        name: 'Todo (functional)',

        'submit form': function () {
            return this.remote.get(require.toUrl(url))
                .findById('new-todo').then(function (val) {}, function(err) {
                     console.log(err);
                }).click();
        }
    });
}
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

$ intern-runner config=tests/example_intern
Listening on 0.0.0.0:9000
Starting tunnel...
Error: Attempt to require unloaded module leadfoot/Command
  at contextRequire  <node_modules/intern/node_modules/dojo/dojo.js:255:12>
  at module.require.result  <node_modules/intern/node_modules/dojo/dojo.js:284:13>
  at </home/bogdanbiv/WebstormProjects/life-tracker3/dojo-example/tests/functional/Todo.js:9:16>
  at execModule  <node_modules/intern/node_modules/dojo/dojo.js:515:54>
  at <node_modules/intern/node_modules/dojo/dojo.js:504:12>
  at Array.map  <native> …
Run Code Online (Sandbox Code Playgroud)

javascript dojo intern

1
推荐指数
1
解决办法
721
查看次数

标签 统计

javascript ×2

backbone-events ×1

backbone.js ×1

cors ×1

dojo ×1

http ×1

intern ×1