Monday, 13 February 2017

javascript - Body.onLoad seems to execute too early

EDIT : SORRY, PROBLEM IS DIFFERENT
- It should be



and inside init_GLSLScreen() I need to run updateShader with textarea name="txtScene" as an argument. Like this



function init_GLSLScreen(){
// ... some stuff ... don't care
console.log ( document.getElementById("txtScene") );
updateShader( document.getElementById("txtScene") );

// ... some stuff ... don't care
}


But document.getElementById("txtScene") returns null



The problem is described here with solution to either move the javascript below HTML (I guess not possible in my case) or to run the javascript onLoad ... which I do but does not work.







Striped down code which reproduces this behaviour (if you look into web-console)






05.10 - Custom fragment shader










No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...