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

DSPE-PEG-Silane, DSPE-PEG-SIL, phospholipid-polyethylene glycol-silane modified active group

Cloud server installation and deployment of Nacos 2.0.4 version

require模块化语法

删库后!除了跑路还能干什么?

MySQL中JOIN的用法

@Autowired与@Resource区别

化学试剂磷脂-聚乙二醇-羟基,DSPE-PEG-OH,DSPE-PEG-Hydroxyl,MW:5000

MySQL常见的索引

第一篇博客

String comparison size in MySQL (date string comparison problem)
随机推荐
配置mmdet来训练Swin-Transformer之一配置环境
AttributeError: Can‘t get attribute ‘SPPF‘ on <module ‘models.common‘ from ‘/yolov5-5.0/models/commo
AttributeError: Can't get attribute 'SPPF' on
网址URL
啃瓜记录又一天
@Accessors 注解详解
np.isnan()
如何查看一个现有的keil工程之前由什么版本的keil IDE编译
sh: 1: curl: not found
C语言中关于2的n次方求值问题(移位运算)
分布式领域最重要的一篇论文,到底讲了什么?
sh: 1: curl: not found
通过PS 2021 将网页图标抠下来
How to check whether a table is locked in mysql
Scientific research reagent DMPE-PEG-Mal dimyristoylphosphatidylethanolamine-polyethylene glycol-maleimide
每天填坑,精卫填坑第二集,TX1 配置从固态启动,安装Pytorch
@Autowired与@Resource区别
@Autowired注解的使用
错误:with open(txt_path,‘r‘) as f: FileNotFoundError: [Errno 2] No such file or directory:
删库后!除了跑路还能干什么?