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

WordPress: How to create an iframe refresh button

Let’s say you have an interactive canvas loaded in an iframe and you want to have the ability to “clear” the canvas without reloading the entire page. This example was created using p5.js and the html was loaded into an iframe. After drawing on this canvas, it can be cleared by clicking the “Clear Canvas” … Continue reading WordPress: How to create an iframe refresh button

p5.js: Getting Started

Getting started with p5.js, this article follows the instructions found here: https://p5js.org/get-started/ Where processing.py only allows interaction in the Processing code environment, p5.js allows for real time interactive experiences on the web. This article is similar to the previous article I wrote about getting started with Processing.py: Processing.py: Getting Started In the Processing IDE, choose … Continue reading p5.js: Getting Started

WordPress: Inject custom CSS to create borders around iframes and images

CSS can be used to style an iframe to give it a border with a drop shadow. For example: #iframe_drop_shadow { -moz-box-shadow: 4px 4px 14px #000; -webkit-box-shadow: 4px 4px 14px #000; box-shadow: 4px 4px 14px #000; } Then, in the tag that creates the iframe, reference this CSS using the tag id=”iframe_drop_shadow”. For example: <iframe … Continue reading WordPress: Inject custom CSS to create borders around iframes and images

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

WordPress: How to create a Table of Contents page with Python

What I wanted to create was a dynamic Table of Contents page where I could have a listing of all of my published articles, organized by category, and sorted such that categories with the most posts appear first, and the posts under each category are listed from most recent at the top to oldest at … Continue reading WordPress: How to create a Table of Contents page with Python

WordPress: How to use an iframe to pull in outside content

Here are instructions for using an iframe with wordpress.org websites. 1.  Download the iframe Plugin from here. iframe 2.  Use a shortcode in a post like this: Note: I added a space after the left bracket [ and before the right bracket ] in order to not trigger the shortcode in the below code example. … Continue reading WordPress: How to use an iframe to pull in outside content