惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tenable Blog
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
H
Help Net Security
F
Fortinet All Blogs
MyScale Blog
MyScale Blog
宝玉的分享
宝玉的分享
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 司徒正美
量子位
N
Netflix TechBlog - Medium
Apple Machine Learning Research
Apple Machine Learning Research
小众软件
小众软件
Recorded Future
Recorded Future
博客园 - 三生石上(FineUI控件)
Vercel News
Vercel News
aimingoo的专栏
aimingoo的专栏
I
InfoQ
Microsoft Security Blog
Microsoft Security Blog
Scott Helme
Scott Helme
The Last Watchdog
The Last Watchdog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
AI
AI
WordPress大学
WordPress大学
Security Archives - TechRepublic
Security Archives - TechRepublic
Google Online Security Blog
Google Online Security Blog
U
Unit 42
V2EX - 技术
V2EX - 技术
MongoDB | Blog
MongoDB | Blog
Schneier on Security
Schneier on Security
博客园 - Franky
H
Heimdal Security Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Jina AI
Jina AI
W
WeLiveSecurity
P
Privacy & Cybersecurity Law Blog
Cloudbric
Cloudbric
B
Blog RSS Feed
N
News | PayPal Newsroom
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
I
Intezer
Hacker News - Newest:
Hacker News - Newest: "LLM"
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园_首页
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
雷峰网
雷峰网

博客园 - 吹鱼算法

自己出的一套前端笔试题 Vue 数组封装和组件data定义为函数一些猜测 背景图片 设置距右边距离 手机端 一个像素线解决方案 css3 div 居中 怎么布局宽度自适应的正方形 前端Mvvm QC 设计解析 前端Mvvm QC 上传了测试版 对react的几点质疑 Display: table-cell实现img、文字垂直居中 为什么我们的web前端变的越来越复杂 扔格子游戏 -webkit-overflow-scrolling:touch iosBug on 在ios下 父对象是body的时候会 不调用 动态是执行脚本 html的转码玉反转码 获取url据对路径写法 CSS 外边距合并 页面禁制选中元素的 背景变蓝的通用写法
js文件获取自身的URL路径
吹鱼算法 · 2019-06-03 · via 博客园 - 吹鱼算法

我们做框架开发的时候,经常需要js文件获取的到自身的路径,在网上查了些资料,总结 了两种方式

浏览器支持docment.currentScript.src 直接用这个获取,不用支持的情况

try{

 null.split()

}catch(e){

e.stack  // 在错误信息的栈信息里获取

}