小编dup*_*r51的帖子

Bootstrap - 警报错误不起作用

我正在编写一个Web脚本来处理VPS创建和销毁.在管理页面上,我使用Twitter Bootstrap显示成功和失败消息的警报.这就是问题,.alert-successdiv工作,但.alert-error不是.我有大部分代码(减去PHP脚本),贴在这里Pastebin上 .

我有它的外观给我的Internet Explorer 11的截图在这里.

在此输入图像描述

请注意,警报成功区域有效.我使用Custom Bootstrap来改变字体,但就是这样.我使用getbootstrap.com网站创建它,所以我怀疑是这样的.

javascript css jquery html5 twitter-bootstrap

11
推荐指数
2
解决办法
1万
查看次数

nodejs - 这是"这个"?

所以这是一个尴尬的问题,但我正在学习NodeJS,我有一个问题.在Java中,当我从一个对象调用一个方法时,该this实例保持不变(如本例所示).

private Test inst;
public Test() {
    inst = this;
    this.myFunction();
}

private void myFunction() {
    System.out.println(inst == this);
}
Run Code Online (Sandbox Code Playgroud)

这返回true(理论上,这个代码离我头顶).但是,在NodeJS中,当我尝试做类似的事情时,它失败了.

var MyObject = function () {
    this.other = new OtherObject();
    this.other.on("error", this.onError);
    console.log(this); //This returns the MyObject object
}

MyObject.prototype.onError = function (e) {
    console.log(this); //This returns the OtherObject object, where I thought it would return the MyObject object.
}
Run Code Online (Sandbox Code Playgroud)

我的问题是为什么会这样,如果我这样做不正确,我怎样才能从onError方法正确引用MyObject实例中的其他变量?

javascript node.js

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

标签 统计

javascript ×2

css ×1

html5 ×1

jquery ×1

node.js ×1

twitter-bootstrap ×1