To determine whether the browser supports canvas, the specific code is as follows: Copy the code The code is as follows: canvas <br>window.onload = function(){ <br>/**Determine whether the browser supports canvas**/ <br>try{ <br>document.createElement('canvas').getContext('2d' ); <br>var addDiv = document.createElement('div'); <br>addDiv.innerHTML='support canvas'; <br>document.body.appendChild(addDiv); <br>}catch(e){ <br>var addDiv = document.createElement('div'); <br>addDiv.innerHTML='The browser does not support canvas'; <br>document.body.appendChild(addDiv); <br>} <br>} ; <br>