خرید بک لینک

Vote count: 0

Could the following code ever throw an error?

var canvas = document.createElement("canvas");

var ctx = canvas.getContext("somethingwrong");

In chromium, it does just retu null.

How would it be if the the requested rendering context is known to a browser? (Like "webgl" or "experimental-webgl") Is there the possibility of an error exception? In chromium I could not provoke this behavior.

In other words: Do I need to wrap this code in a try/catch in a library that checks cleanly for a rendering context?

Is there maybe a way to objectify this? E.g. by a web service that tries a code snipped in different browsers and lists their possibly differing results.

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 30 فروردين 1395 ساعت: 13:57

صفحه بندی