Coder Social home page Coder Social logo

Comments (7)

jeffhuang avatar jeffhuang commented on July 20, 2024

Any progress on this issue? This seems to be a tough one to track one.

from webgazer.

Jack-Wong94 avatar Jack-Wong94 commented on July 20, 2024

It appears the webgl is not properly set up when the webgazer.js is in the head. It is because the browser will download the javascript and proceed down the line of the html. If the javascript url reference in the head gets stuck it would cause the issue. I have add an async tag when putting the script reference into and it seems to solve the problem.

from webgazer.

jeffhuang avatar jeffhuang commented on July 20, 2024

Ahh good find! That makes sense. Would async still occasionally cause problems since it's sort of introducing a race condition? Do you have a suggestion to make sure that developers do this properly to avoid this bug in the future?

from webgazer.

Jack-Wong94 avatar Jack-Wong94 commented on July 20, 2024

Using async will excute the script while the page continues parsing. From what I see, it doesn't cause problem regarding switching to the slower version of javascript. But if the race condition does cause problem, they can use defer instead of async which would parsing the page first before excuting webgazer.js. It would still solve the problem but also eliminate the potential of introducing a race condition.

from webgazer.

jeffhuang avatar jeffhuang commented on July 20, 2024

Got it, async sounds like a good solution for now. defer might make things load a bit slower, but might be good to mention as well. Can we add a note about using async/defer in the documentation/readme?

from webgazer.

Jack-Wong94 avatar Jack-Wong94 commented on July 20, 2024

Yes, we could add the note into the readme

from webgazer.

idaknow avatar idaknow commented on July 20, 2024

Added a note to the README regarding this

from webgazer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.