Tips & Tutorials

5 Ways to Pass Variables Between Pages In Javascript

Welcome to a tutorial on how to pass variables between pages in Javascript. Need to pass some data between different pages? An easy way to pass variables between pages is to use a query string: On the first page: var para = new URLSearchParams(); para.append(“KEY”, “VALUE”); location.href = “HTTP://SITE.COM/PAGE.HTML?” + para.toString(); On the second page:

5 Ways to Pass Variables Between Pages In Javascript Read More »

Toggle Fullscreen Mode With Javascript (Very Simple Examples)

Welcome to a quick tutorial and examples of how to toggle fullscreen mode with Javascript. Yes, the old grandmother’s age of the Internet is over now. Modern web browsers can be switched to full-screen mode in Javascript easily. To enter fullscreen mode for the entire page  – document.documentElement.requestFullscreen() To enter fullscreen mode for a specific

Toggle Fullscreen Mode With Javascript (Very Simple Examples) Read More »

Javascript Fetch With HTTP Basic Auth (Simple Example)

Welcome to a tutorial and example on how to do a Javascript Fetch request with HTTP basic auth. To perform Fetch with HTTP basic auth, simply include the authorization headers in the request. var credentials = btoa(“USER:PASSWORD”); var auth = { “Authorization” : `Basic ${credentials}` }; fetch(“http://site.com/protected/”, { headers : auth }); That covers the

Javascript Fetch With HTTP Basic Auth (Simple Example) Read More »