小编Aby*_*yss的帖子

对象中的对象

var UsersMenu = function(){
    this.returnUsers = [];
    this.retrieve = function(posts){
        var temp = [];
        $.post("router.php", { "action": "getUsersMenu", "posts" : posts},
        function(data)
        {
            if(data.response){    
                for(var i=0; i<data.returnUsers.length; i++){
                    temp.push(data.returnUsers[i]);
                }
                this.returnUsers = temp; // i know what 'this' is incorrect
            }

        }, "json");
                alert(this.returnUsers);
    }
}
Run Code Online (Sandbox Code Playgroud)

2个问题:
1.如何从jq对象(returnUsers)访问父'this'?
2.为什么jq post之后在jq post中发出警告之前会发出警报?

javascript jquery json

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

如何从招摇定义中排除属性

我正在使用Swagger在线编辑器。我在定义中创建一些模型

  Object:
    type: object
    properties:
      id:
        type: integer
        format: int32
      name:
        type: string
      some_variable_to_exclude:
        type: string
Run Code Online (Sandbox Code Playgroud)

这是完整的模型,我在不同的响应中使用它。但是在其中之一中,我希望我的模型不显示属性“ some_variable_to_exclude”。我如何排除它?可能吗 ?
好吧,也许不排除,也许在物业附近发表一些评论,但仅针对该回应。

swagger swagger-editor

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

__halt_compiler之后的代码执行

在我生命中的下一次,我会在函数__halt_compiler之后看到一些字节码.在这种情况下,它是symfony安装程序.怎么做 ?如何生成在__halt_compiler之后可执行的代码?

php symfony

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

标签 统计

javascript ×1

jquery ×1

json ×1

php ×1

swagger ×1

swagger-editor ×1

symfony ×1