JavaScript/axios:修订间差异
来自康健生活
| 第2行: | 第2行: | ||
https://github.com/axios/axios | https://github.com/axios/axios | ||
== 代码设计 == | |||
用工厂模式。 | |||
<syntaxhighlight lang="javascript"> | |||
(function webpackUniversalModuleDefinition(root, factory) { | |||
if(typeof exports === 'object' && typeof module === 'object') | |||
module.exports = factory(); | |||
else if(typeof define === 'function' && define.amd) | |||
define([], factory); | |||
else if(typeof exports === 'object') | |||
exports["axios"] = factory(); | |||
else | |||
root["axios"] = factory(); | |||
})(this, function() { | |||
... | |||
return (function(modules) { | |||
... | |||
})([...]) | |||
})</syntaxhighlight> | |||
== 与AJAX == | == 与AJAX == | ||
2020年6月22日 (一) 00:01的版本
引言
https://github.com/axios/axios
代码设计
用工厂模式。
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["axios"] = factory();
else
root["axios"] = factory();
})(this, function() {
...
return (function(modules) {
...
})([...])
})
与AJAX
Axios
Promise based HTTP client for the browser and node.js
AJAX
Asynchronous Javascript And XML
No categories