3D Web · Exercise 1 of 4Next
Intermediate
Show the picture when WebGL is missing
This page pretends the visitor's browser has no WebGL. Right now startScene() would throw.
Write supportsWebGL2() (safe against getContext throwing). When it is false, show #fallback with a sentence in #reason and a text alternative on its picture, and create no canvas.
What Check tests
- No canvas was made
- The fallback is shown
- A reason is written in plain words
- The picture has a text alternative
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.