当前位置:网站首页>Shim and Polyfill in [concept collection]
Shim and Polyfill in [concept collection]
2022-07-03 06:53:00 【Alisone_ li】
shim
Is a small class library (lib), Provide independent API, To make up for the compatibility problem that people need to consider when using native languages in different environments .
such as : Use js Native Ajax In operation , Do you use XMLHttpRequest establish xhr object , But in IE8 On , You have to use ActiveXObject, To solve these compatibility problems , At the same time, simplify the operation ,jQuery There is .
jQuery The core idea is : write less,do more! therefore ,jQuery Can be seen as a shim.
polyfill
Is a small class library (lib), It's used to implement native that browsers don't support API Code for .
such as :IE9 The following is not supported html5 Some new labels , have access to HTML5 shim For compatibility ; Older browsers don't support ES6 as well as ES6+ Some new features of , have access to Babel To compile into ES5 Syntax compatible .
The code example is as follows :
if (!window.XMLHttpRequest) { window.XMLHttpRequest = function () { .... } }Be careful
Native API Code for , It can be called polyfill Class library of , The solution must be in an incompatible environment , Redefinition JS Its own grammar , Will not redefine API.
shim and polyfill
1,shim and polyfill The purpose of is to solve browser compatibility , And provide convenient , This is also a class library (lib) One of the functions of ;
2,shim Contains polyfill, Wider scope , You can redefine API, and polyfill Relatively narrow ,API It must be JS standard ;
边栏推荐
- Jmeter+influxdb+grafana of performance tools to create visual real-time monitoring of pressure measurement -- problem record
- [leetcode] day93 - intersection of two arrays II
- 【code】偶尔取值、判空、查表、验证等
- 利用C#实现Pdf转图片
- Numerical method for solving optimal control problem (I) -- gradient method
- [classes and objects] explain classes and objects in simple terms
- Pytest -- write and manage test cases
- 数值法求解最优控制问题(一)——梯度法
- Modify MySQL password
- Redis command
猜你喜欢

DBNet:具有可微分二值化的实时场景文本检测

2022-06-23 VGMP-OSPF-域间安全策略-NAT策略(更新中)

IC_EDA_ALL虚拟机(丰富版):questasim、vivado、vcs、verdi、dc、pt、spyglass、icc2、synplify、INCISIVE、IC617、MMSIM、工艺库

第8章、MapReduce 生产经验
![[untitled]](/img/72/4ff9354634342580a135debb58b60e.jpg)
[untitled]

Yolov2 learning and summary

10万奖金被瓜分,快来认识这位上榜者里的“乘风破浪的姐姐”

New knowledge! The virtual machine network card causes your DNS resolution to slow down

“我为开源打榜狂”第一周榜单公布,160位开发者上榜

【类和对象】深入浅出类和对象
随机推荐
10000小時定律不會讓你成為編程大師,但至少是個好的起點
【5G NR】UE注册流程
Arctic code vault contributor
Machine learning | simple but feature standardization methods that can improve the effect of the model (comparison and analysis of robustscaler, minmaxscaler, standardscaler)
The pressure of large institutions in the bear market has doubled. Will the giant whales such as gray scale, tether and micro strategy become 'giant thunder'?
2021 year end summary
Class and object summary
scroll-view指定滚动元素的起始位置
论文笔记 VSALM 文献综述《A Comprehensive Survey of Visual SLAM Algorithms》
Yolov2 learning and summary
Sorting out the core ideas of the pyramid principle
[open source project recommendation colugomum] this group of undergraduates open source retail industry solutions based on the domestic deep learning framework paddlepadddle
Application scenarios of Catalan number
DBNet:具有可微分二值化的实时场景文本检测
Personally design a highly concurrent seckill system
利用C#实现Pdf转图片
Summary of UI module design and practical application of agent mode
10万奖金被瓜分,快来认识这位上榜者里的“乘风破浪的姐姐”
mongodb
熊市里的大机构压力倍增,灰度、Tether、微策略等巨鲸会不会成为'巨雷'?