Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何处理#&引用;带SASS的Backbone.js需要_Backbone.js_Sass_Compass Sass - Fatal编程技术网

如何处理#&引用;带SASS的Backbone.js需要

如何处理#&引用;带SASS的Backbone.js需要,backbone.js,sass,compass-sass,Backbone.js,Sass,Compass Sass,我正在尝试使用带有指南针的SASS来创建图像精灵。然而,我也在使用backbone.js,所以我的url看起来像:http://localhost/social/#/dashboard 所以当我使用@时,包括箭头精灵($name)它给了我一个类似于:http://localhost/social/#/images/sidebar_buttons/arrow-sa2b2afd371.png 哪个chrome inspector给了我这个错误:资源被解释为图像,但使用MIME类型text/html传

我正在尝试使用带有指南针的SASS来创建图像精灵。然而,我也在使用backbone.js,所以我的url看起来像:
http://localhost/social/#/dashboard

所以当我使用
@时,包括箭头精灵($name)
它给了我一个类似于:
http://localhost/social/#/images/sidebar_buttons/arrow-sa2b2afd371.png

哪个chrome inspector给了我这个错误:
资源被解释为图像,但使用MIME类型text/html传输

如果我从url中删除“#”,则图像加载良好。我的config.rb看起来像:

http_path = "/social/"
project_path = "C:/wamp/social"
css_dir = "styles/css"
sass_dir = "styles/sass"
images_dir = "images"
javascripts_dir = "js"

在config.rb中启用相关资产:

relative_assets = true

请尝试在config.rb中启用相对资源:
relative_assets=true
或切换到绝对URL或使用根目录中的路径。@cimmanon添加您的答案,这样我就可以给您评分了!:)