JS & Node

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 »

Populate Dropdown With AJAX JSON (Simple Example)

Welcome to a quick tutorial on how to populate an HTML dropdown list with AJAX and JSON. Need to dynamically load the dropdown options from the server? No problem, it is actually a simple process – Read on for the example!     TLDR – QUICK SLIDES [web_stories_embed url=”https://code-boxx.com/web-stories/populate-dropdown-ajax-json/” title=”Populate Dropdown With AJAX JSON” poster=”https://code-boxx.com/wp-content/uploads/2021/11/STORY-JS-20230518.webp”

Populate Dropdown With AJAX JSON (Simple Example) Read More »