javascript - requirejs reference css problem
巴扎黑
巴扎黑 2017-05-16 13:38:50
0
4
1618

This is the address: http://ceshi.sosearching.cn/o...

The console error is similar to this,
GET http://ceshi.sosearching.cn/o...
Uncaught Error: Script error for "fontAwesomeCss"

Could you please help me with some research? Thank you

巴扎黑
巴扎黑

reply all(4)
小葫芦

Require to load CSS requires a css.js plug-in, you can refer to Use RequireJS to unified manage JS and CSS

仅有的幸福

Can requirejs reference CSS? Or is the CSS all written in JS?

阿神

Failed to load resource: the server responded with a status of 404 (Not Found)
Your "XXCSS.js" file cannot be found at all. Check to see if there is anything wrong? Is the path correct?

仅有的幸福

The css referenced by require must be a dependency of a certain js, and it must be declared as css in the header

datepicker: {
    deps: [
        'jquery',
        'css!../../jslibs/jquery-ui/themes/base/jquery-ui.css',
        'css!../../jslibs/jquery-ui/themes/base/datepicker.css',
        'css!../../jslibs/jquery-ui/themes/base/base.css',
    ]
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template