Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6851895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:18:13+00:00 2026-05-27T01:18:13+00:00

On my website I host a WebGL game. When the WebGL fails to initialize

  • 0

On my website I host a WebGL game. When the WebGL fails to initialize it just shows a huge empty space on the page. Is it possible to show something different here when the initialization fails?

Here’s the website:
http://www.pabloproductions.be/Planetoids.html At the top you can play the game, if you have webGL enabled.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:18:14+00:00Added an answer on May 27, 2026 at 1:18 am

    All of the Three.js examples that I’ve seen come with ‘Detector.js’…Works well, reports if your browser or video card does not support WebGL. Check it out…
    https://github.com/mrdoob/three.js/

    I’m using his Dector.js on the development version of my personal site (not deployed yet), and using the results as well to load alternate content in the event that WebGL is not supported by a user’s browser. Take a look in any of the examples at the Three.js repository, Detector.js is in the js folder, and the code is called at the top of most of the examples (if not all of them). I use it like this

    if (! Detector.webgl ) {
        // run the same old javascript that I've been using here
    }
    

    and a

    if ( Detector.webgl ) {
      // remove the head so I can run some WebGL stuff here
    }
    

    etc, etc…

    and the reporting section I do this (the append code is for my site, put what you like of course…Basically put whatever you need in the ‘if NOT’ condition

    if ( ! Detector.webgl ) {
            var underText;//this holds the element that we will use to draw in
            underText = document.getElementById("webgl-box");
    
            $('.webgl-box').append('<p style="font-size: 14px;"><img src="<?= $this->baseUrl() ?>/images/red-x.png" /> No, This page does NOT detect support for WebGL<br />\n\
                                           Here are some resources to help you get started with WebGL</p>');
            $('.webgl-box').append(Detector.getWebGLErrorMessage());
    
            $('.webgl-box').append('<p style="font-size: 14px;">Firefox for Android also supports WebGL</p>');
    
            }
    

    The Detector.getWebGLErrorMessage() is whats returned from the Dector.js, just look in the source of Detector.js and you will see whats going on, detector.js is pretty small and you can modify it to return whatever ‘message’ or anything that you need as well.

    Nice game by the way 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have a website hosted on a shared server (e.g. Just Host), but
I just finished setting up a Rackspace Cloud Server to host a website I'm
I'm developing a website that will host some videos. The client wants control over
I am trying to create a website where I host my data on google
Is there a detailed guide which explains how to host a website on your
Thank you for the answers. :) I'm mainly looking to host my website with
A website of mine will host the usual images, javascript and CSS stylesheets in
I am searching for a host for a new commercial website. Among other things,
I have a personal website with a MediaWiki installation on a shared host. The
Last weekend I changed webhosts for my website. The host server I was on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.