从网址传递数据时,公共CSS和JS未加载 [英] Public css and js is not loading while while pass data from url

查看:49
本文介绍了从网址传递数据时,公共CSS和JS未加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

->http://localhost:8000/edit-category

-> http://localhost:8000/edit-category

->http://localhost:8000/public/assets/images/users/avatar-1.jpg

-> http://localhost:8000/public/assets/images/users/avatar-1.jpg

->http://localhost:8000/edit-category/12

-> http://localhost:8000/edit-category/12

->http://localhost:8000/edit-category/public/assets/images/users/avatar-1.jpg

-> http://localhost:8000/edit-category/public/assets/images/users/avatar-1.jpg

如果我从url中删除了edit-category,那么所有的CSS和JS都会呈现

if i remove edit-category from url then all css and js will render

任何人都可以帮助我在Express节点上解决此问题.

Can anyone help me to solve this problem in node with express.

推荐答案

在头部使用< BaseUrl/> 标记.这样可以解决问题

Use <BaseUrl /> tag in head. this will solve the problem

这篇关于从网址传递数据时,公共CSS和JS未加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆