[英]Multiple versions of html2canvas
我將html2canvas的版本從v0.5.0更新到v1.0.0,然后某些功能在iOS上停止工作。
因此,我想在iOS上使用v0.5.0,在其他設備上使用v1.0.0。
如何在我的Web應用程序上擁有和使用兩個版本的html2canvas?
嘗試編寫自定義函數。
(function (w, d) {
"use strict";
var h = d.getElementsByTagName("head")[0],
s = d.createElement("script");
w.d3 = null;
s.src ="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.5.0/html2canvas.min.js";
s.onload = function () {
w.d3_3_5_3 = w.d3;
w.d3 = undefined;
s = d.createElement("script");
s.src ="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.5.0/html2canvas.min.js";
s.onload = function () {
w.d3_3_5_4 = w.d3;
w.d3 = undefined;
s = d.createElement("script");
s.src = "https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.0.0/html2canvas.min.js";
s.onload = function () {
w.d3_3_5_5 = w.d3;
w.d3 = undefined;
};
h.appendChild(s);
};
h.appendChild(s);
};
h.appendChild(s);
}(window, document));
希望這可以幫助。!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.