Homework: Arrays
Homework Create a new codepen called colorblocks. Make your body background be gray and your canvas white. Create an array with three different colors in hexadecimal. Print out a 100 by 100 pixel square of each of the three colors in a horizontal line. Add a fourth color and a fifth color to the array…
Read MoreJoining, Splitting & Converting Arrays
Note: this section is not needed for the homework – more like side info! Converting Arrays to String The JavaScript method toString() converts an array to a string of comma separated array values. var animals =[“monkey”, “panda”, “shark”, “cat”, “bunny”]; document.write(animals.toString()); Output monkey, panda, shark, cat, bunny The join() method does the same thing but…
Read MoreChanging Arrays
Adding or Removing Elements The easiest way to add elements to an array is to use the push method. kids.push(“ Kate ”); //kids is now [‘Teo’, ‘Cal’, ‘Zoe’, ‘Tessa’, ‘Kate’] You can also add an element using the length property. kids[kids.length] = “ Fiona ”; //kids is now [‘Teo’, ‘Cal’, ‘Zoe’, ‘Tessa’, ‘Kate’, ‘Fiona’] You…
Read MoreHomework: Add Data
In the last homework, you should have created the tables below in phpMyAdmin. Now add at least 5 rows of data per table. Don’t forget to make index fields match!
Read MoreAdd Data to Tables with phpMyAdmin
Creating a table is the first step, now it needs some data. There are many different ways on how to go about getting data in this table. You can import data from another source such as another database table, an Excel spreadsheet or text listing. You can integrate it with a website via a form…
Read MoreHomework: Converting Strings & Numbers
Your homework is to write a bit of code called convert.html. In that you will do both Example 1 & Example 2 from the topic! Here they are again: Example 1 You are calculating the cost of an ice cream based on how many scoops and toppings the person is asking for. Scoops are $1.00…
Read MoreString Methods in JavaScript
In JavaScript there are lots of ways to manipulate strings including: finding certain characters in a string, replacing characters, splitting a string or converting the case. Basic String Methods These are two of the most basic string methods. String Length: returns the length of the string or the number of characters in the string. var…
Read MoreHomework: Numbers
Create a file called numbers.html for Part 1. Here’s a formula you will need to figure out the area of a trapezoid.
Read MoreAdding Images
Whenever you want to deal with images, video or other types of media – you will be working with media library in WordPress. This is where WordPressstores all the images, video and other media that you upload so that you can include it on your website. Think of it as giant repository on your website…
Read MoreKeeping Your Site Updated
Your Best Defense? ALWAYS, ALWAYS, ALWAYS – KEEP YOUR SITE UP TO DATE!!! Sorry for the shouting but this is critical. Make sure you have the latest version of WordPress and all your plugins. How? Many ways. But the easiest way to see is to simply look at our left hand column of your Dashboard.…
Read More