JavaScript: How to identify the browser using navigator.userAgent

While it is not a good programming practice to code workarounds for various browsers and versions , it is helpful to know how to detect the user’s browser. For example: Here is the complete HTML code that includes JavaScript that will detect the user’s browser and other information such as operating system: Some key pieces of … Continue reading JavaScript: How to identify the browser using navigator.userAgent

Vue.js: How to install Vue.js on Ubuntu Linux

Vue.js requires that Node.js version 6.x is already installed. See this previous article for instructions on installing Node.js: JavaScript: How to install Node.js on Ubuntu Linux To install Vue.js, use each one of these commands in the Ubuntu terminal, in order: Command #1: sudo npm install –g vue-cli Command #2: vue init webpack myapp Where … Continue reading Vue.js: How to install Vue.js on Ubuntu Linux

JavaScript: How to install Node.js on Ubuntu Linux

To install Node.js version 6.x on Ubuntu Linux VM, start by going here: https://nodejs.org/ Click on the DOWNLOADS link at the top, then click on the “Installing Node.js via package manager” link. Then under “Debian and Ubuntu based Linux distributions“, there are two commands to use. Run these commands, in order, in the Ubuntu terminal. … Continue reading JavaScript: How to install Node.js on Ubuntu Linux

JavaScript: How to create alerts and pop-up windows

In JavaScript, alerts can be created easily using the built-in alert() function. For this first example, an alert is placed directly inside the button tag: <button onclick=”alert(‘I am an alert box!’);”>Example 1</button> Example 1 Here is a more complete example, showing in the HTML context: <!DOCTYPE html> <html> <body> <h2>JavaScript Alert Example 1</h2> <button onclick=”alert(‘I … Continue reading JavaScript: How to create alerts and pop-up windows

Python and JavaScript: A comparison of the language basics

In this table I will compare some basic programming syntax and conventions between the Python and JavaScript programming languages. Programming element Python JavaScript Creating a variable that contains an int: age = 25 var age = 25; Creating a variable that contains a float: probability = 0.62 var probability = 0.62; Creating a variable that … Continue reading Python and JavaScript: A comparison of the language basics