当前位置:网站首页>相对路径和绝对路径
相对路径和绝对路径
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"
边栏推荐
猜你喜欢

require模块化语法

querystring模块

yolov5调用ip摄像头时出现的问题

String comparison size in MySQL (date string comparison problem)

Deveco studio Hongmeng app access network detailed process (js)

AttributeError: 'Upsample' object has no attribute 'recompute_scale_factor'

DSPE-PEG-PDP, DSPE-PEG-OPSS, phospholipid-polyethylene glycol-mercaptopyridine supply, MW: 5000
[email protected]在static属性上的使用"/>@Autowired详解[email protected]在static属性上的使用

Phospholipid-polyethylene glycol-targeted neovascularization targeting peptide APRPG, DSPE-PEG-APRPG

配置mmdet来训练Swin-Transformer之一配置环境
随机推荐
ssm various configuration templates
啃瓜记录又一天
Mysql8.0安装教程
oracle内连接和外连接
Mysql8创建用户以及赋权操作
String comparison size in MySQL (date string comparison problem)
sh: 1: curl: not found
Debian 10 NTP Service Configuration
np.isnan()
Chapter 10 Clustering
网址URL
AttributeError: ‘Upsample‘ object has no attribute ‘recompute_scale_factor‘
MySQL占用CPU过高,排查原因及解决的多种方式法
删库后!除了跑路还能干什么?
STM32 触发HardFault_Handler如何查找原因
动态代理工具类
@DateTimeFormat注解
Cloud server installation and deployment of Nacos 2.0.4 version
@Configuration详解
SSM整合