当前位置:网站首页>相对路径和绝对路径
相对路径和绝对路径
2022-08-02 03:22:00 【cjx177187】
本地相对路径:[file://c:/]
页面本地打开,在这个页面中写路径:./src/18.jpg src/18.jpg 路径的文件是本地打开的
本地绝对路径:[file:C:/]
从根盘开始写路径
相对网络路径:当前网页的网址
"./src/18.jpg" ==> "协议://ip:port /src/news/src/18.jpg"
"src/18.jpg" ==> "协议://ip:port /src/news/src/18.jpg"
举例1:
用户输入网址:
"http://192.168.6.60:8080/user/20220728/newspage.html?n=20"
打开了一个页面,在这个页面中有一个img的src是 : "./src/18.jpg"
请问192.168.6.60:8080这个服务器会受到req.url是什么?
答: "/user/20220728/src/18.jpg"
举例2:
用户输入网址:
"http://192.168.6.60:8080/user/20220728/newspage"
打开了一个页面,在这个页面中有一个img的src是 : "./src/18.jpg"
请问192.168.6.60:8080这个服务器会受到req.url是什么?
答: "/user/20220728/src/18.jpg"
它真正的网址:"http://192.168.6.60:8080/user/20220728/src/18.jpg"
绝对网络路径:[协议://ip:port pathname querystring hash]
举例:
用户输入网址: http://192.168.6.60:8080/user/20220728/newspage
打开了一个页面,在这个页面中有一个img的src是 : "192.168.6.60:8080/src/18.jpg"
请问192.168.6.60:8080这个服务器会受到req.url是什么?
答: "/user/20220728/192.168.6.60:8080/src/18.jpg"
它真正的网址:"http://192.168.6.60:8080/user/20220728/192.168.6.60:8080/src/18.jpg"
本地相对根路径:
举例:
用户本地打开: "file:///c:/xx/xx2/index.html"
页面中有一个img的src是 : "/src/18.jpg"
它真正的路径:"file:///c:/src/18.jpg"
本地绝对根路径:
举例:
用户输入网址: http://192.168.6.60:8080/user/20220728/newspage
打开了一个页面,在这个页面中有一个img的src是 : "/src/18.jpg"
请问192.168.6.60:8080这个服务器会受到req.url是什么?
答:"/src/18.jpg"
它真正的网址:"http://192.168.6.60:8080/src/18.jpg"
边栏推荐
- ModuleNotFoundError No module named 'xxx' possible solutions
- C语言的变长数组
- Mysql8.0安装教程
- String comparison size in MySQL (date string comparison problem)
- DSPE-PEG-PDP,DSPE-PEG-OPSS,磷脂-聚乙二醇-巯基吡啶供应,MW:5000
- subprocess.CalledProcessError: Command ‘pip install ‘thop‘‘ returned non-zero exit status 1.
- IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boo
- 3分钟带你了解微信小程序开发
- Redis simple study notes
- Phospholipid-Polyethylene Glycol-Aldehyde DSPE-PEG-Aldehyde DSPE-PEG-CHO MW: 5000
猜你喜欢
Knowledge Engineering Assignment 2: Introduction to Knowledge Engineering Related Fields
PCL—point cloud data segmentation
DSPE-PEG-DBCO 磷脂-聚乙二醇-二苯并环辛炔 一种线性杂双官能聚乙二醇化试剂
如何查看一个现有的keil工程之前由什么版本的keil IDE编译
啃瓜记录第一天
ModuleNotFoundError No module named 'xxx' possible solutions
远程调试、无cuDnn、自定义模块无法导入问题记录
【我的创作纪念日】 3周年
Cloud server installation and deployment of Nacos 2.0.4 version
[Basic Tutorial of Remote Control Development 1] Crazy Shell Open Source Formation Drone-GPIO (Remote Control Indicator Light Control)
随机推荐
mysql创建表
sh: 1: curl: not found
UserWarning:火炬。meshgrid:在以后的版本中,它将被要求通过索引ing argu
我的两周年创作纪念日
活体检测 Adaptive Normalized Representation Learning for GeneralizableFace Anti-Spoofing 阅读笔记
getattr() function analysis
np.unique()函数
The usage of json type field in mysql
3 minutes to take you to understand WeChat applet development
__dirname
【我的创作纪念日】 3周年
@Accessors 注解详解
AttributeError: Can't get attribute 'SPPF' on
科研试剂DMPE-PEG-Mal 二肉豆蔻酰磷脂酰乙醇胺-聚乙二醇-马来酰亚胺
远程调试、无cuDnn、自定义模块无法导入问题记录
Mysql8.0安装教程
2022年比若依更香的开源项目
Redis笔记进阶篇:万字长文-整理Redis,各种知识点,建议收藏
Phospholipid-Polyethylene Glycol-Aldehyde DSPE-PEG-Aldehyde DSPE-PEG-CHO MW: 5000
oracle内连接和外连接