文章详情页
html - node.js中base标签中href的问题
问题描述
我在node.js中的express中使用static中间件为static(__dirname+’/public’),html中的代码为
我想问一下base标签中的href属性为’/’是什么意思?不是一般都为http...这种属性值么?
问题解答
回答1:app.use(express.static(__dirname+’/public’));这行代码是设置你的静态资源的base_url所以在页面中 <base href='https://www.haobala.com/'> /代表着你设置的静态资源路径
标签:
HTML
上一条:node.js - react应用加了react-redux后webpack打包后页面显示空白,也没有报错下一条:node.js - vue-cli webpack express配置服务端路由规则
相关文章:
1. 关于《Effective Java中文版(第2版)》的问题2. angular.js - angular.ui:dropdown的下拉菜单关闭的偶尔失常问题3. Angular.js 无法设置Authorization头,该怎么解决?4. angular.js - angularjs ng-repeat 不能刷新5. javascript - html5显示隐藏6. angular.js - angularjs怎么实现跳转的,是要写路由吗7. docker 下面创建的IMAGE 他们的 ID 一样?这个是怎么回事????8. css - 移动端 oppo 手机之 Border-radius9. php laravel框架模型作用域10. PHP中的$this代表当前的类还是方法?
排行榜