当前位置:网站首页>相对路径和绝对路径
相对路径和绝对路径
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"
边栏推荐
- subprocess.CalledProcessError: Command ‘pip install ‘thop‘‘ returned non-zero exit status 1.
- basic operator
- C语言 内联函数
- @ApiModel 和 @ApiModelProperty
- 如何查看一个现有的keil工程之前由什么版本的keil IDE编译
- pyppeteer使用样例脚本
- mysql中json类型字段用法
- 利用 nucleo stm32 f767zi 进行USART+DMA+PWM输入模式 CUBE配置
- The @autowired distinguished from @ the Resource
- 错误:with open(txt_path,‘r‘) as f: FileNotFoundError: [Errno 2] No such file or directory:
猜你喜欢

语义分割标签即像素值的巨坑,transforms.ToTensor()的错误使用

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

Phospholipid-polyethylene glycol-hydrazide, DSPE-PEG-Hydrazide, DSPE-PEG-HZ, MW: 5000

oracle内连接和外连接

【手把手带你学nRF52832/nRF52840 · (1)开发环境搭建】

Chapter 10 Clustering

Usage of JOIN in MySQL

磷脂-聚乙二醇-酰肼,DSPE-PEG-Hydrazide,DSPE-PEG-HZ,MW:5000

磷脂-聚乙二醇-巯基,DSPE-PEG-Thiol,DSPE-PEG-SH,MW:5000

【我的创作纪念日】 3周年
随机推荐
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
DSPE-PEG-Silane, DSPE-PEG-SIL, phospholipid-polyethylene glycol-silane modified active group
Error: with open(txt_path,'r') as f: FileNotFoundError: [Errno 2] No such file or directory:
Monaco Editor 的基本用法
Chemical reagent Phospholipid-polyethylene glycol-hydroxyl, DSPE-PEG-OH, DSPE-PEG-Hydroxyl, MW: 5000
nucleo stm32 h743 FREERTOS CUBE MX配置小记录
第一篇博客
sh: 1: curl: not found
SOCKS5
JJWT工具类
删库后!除了跑路还能干什么?
【我的创作纪念日】 3周年
Mysql8.0安装教程
Redis笔记基础篇:6分钟看完Redis的八种数据类型
Phospholipid-polyethylene glycol-thiol, DSPE-PEG-Thiol, DSPE-PEG-SH, MW: 5000
mysql卸载详细教程
云服务器安装部署Nacos2.0.4版本
js 取字符串中某位置某特征的值,如华为(Huawei)=>华为
Dynamic proxy tool class
磷脂-聚乙二醇-巯基,DSPE-PEG-Thiol,DSPE-PEG-SH,MW:5000