search

Home  >  Q&A  >  body text

javascript - requirejs reference css problem

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

巴扎黑巴扎黑2757 days ago1623

reply all(4)I'll reply

  • 高洛峰

    高洛峰2017-05-16 13:40:50

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

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-16 13:40:50

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

    reply
    0
  • 阿神

    阿神2017-05-16 13:40:50

    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?

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-16 13:40:50

    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',
        ]
    }

    reply
    0
  • Cancelreply