使用canvas渲染时,需要在html中存在canvas标签。才能绘制,插件不会自己生成canvas。 在使用jq的qrcode插件生成二维码时,不用在html中有canvas,只需要指定一个dom,会在这个dom中生成一个canvas标签。