无法访问外部css或javascript文件

时间:2016-02-20 07:45:59

标签: javascript html css

目前我正在使用libwebsockets https://github.com/warmcat/libwebsockets/blob/fix_readme_format/README.test-apps.md

我已在主目录中构建并安装。我使用README.test-apps.md自述文件运行测试服务器创建了websocket,但服务器没有在html代码(test.html)中访问css或javascript文件。

我谷歌,但大多数地方说,将权限更改为755到服务器目录,但它没有帮助我。

我的电脑是Ubuntu 14.04。

以下是快照。

enter image description here

1 个答案:

答案 0 :(得分:0)

在终端中,您应键入

// get female instance of Jade
var jade = createHumanByGender.bind( this, 'Female', 'Jade', 'Taylor' )();
console.log( jade.getFullName() );


// ------------------------------------------------
// HUMAN
function Human ( forename, surname ) {
    this.forename = forename;
    this.surname = surname;
    this.age = 0;
}

Human.prototype = {
    getForename : function () {
        return this.forename;
    },
    getSurname : function () {
        return this.surname;
    },
    getFullName : function () {
        return this.forename + ' ' + this.surname;
    }
};


// MALE
function Male ( forename, surname ) {
    Human.call( this, forename, surname );
    this.gender = 'Male';
}
Male.prototype = Object.create( Human.prototype );


// FEMALE
function Female ( forename, surname ) {
    Human.call( this, forename, surname );
    this.gender = 'Female';
}
Female.prototype = Object.create( Human.prototype );


// GENDER
function createHumanByGender ( gender, forename, surname ) {
    return new this[gender]( forename, surname );
}