i use processing.js and jQuery and the code below to detect the window size of the browser
void setup() {
size( $(window).width(),$(window).height() );
However, the default size is shown before the jQuery successfully detects the width and height, and it won’t resize until i refresh the browser manually。
i am thinking about automatic page refresh .
So how can i tell the computer to refresh page after document loaded?
btw, window.innerWidth, window.innerHeight works the same as what i see with jQuery
Many thanks.
This, in P5 setup(), have worked for me: