标签:window var doc can onload win7 else nload canvas
1、获取 canvas的3D的 context
ZC:发现:Chrome(版本 68.0.3440.106(正式版本)(32 位)) in Win7x64,执行下来 前两个有效
ZC: Qt532_MSVC_OpenGL的Webview运行下来,中间两个有效
ZC: 于是 就用 "experimental-webgl" 吧
window.onload = function() { var canvas = document.getElementById(‘webgl‘); var names = ["webgl", "experimental-webgl", "webkit-3d", "moz-webgl"]; for (var ii = 0; ii < names.length; ++ii) { var context = null; try { context = canvas.getContext(names[ii]); } catch(e) {} if (context) console.log(" != null"); else console.log(" == null"); } };
2、
3、
4、
5、
标签:window var doc can onload win7 else nload canvas
原文地址:https://www.cnblogs.com/h5skill/p/9560664.html