Jan
20
PBS 48 of x – A Closer Look at ‘this’ and ‘static’
Filed Under Software Development, Computers & Tech on January 20, 2018 | 2 Comments
I had initially planned to return to our Cellular Automata classes and Conway’s Game of Life for this instalment, but based on some listener feedback I’ve decided to delay that by at least one instalment and dedicate this entire instalment to a closer look at just two JavaScript keywords – this
and static
instead. The two are more closely related that you might think.
The ZIP file for this instalment contains my sample solution to the challenge set at the end of the previous instalment, the starting point for the next challenge, and a JavaScript file containing all the example code snippets that appear in this instalment.
Oct
29
PBS 42 of x – Playing the Game of Life
Filed Under Software Development, Computers & Tech on October 29, 2017 | 1 Comment
In this instalment it’s finally time to bring our Cellular Automaton prototypes to life by implementing Conway’s Game of Life. By the end of this instalment we’ll have reached a real milestone — our first web app! Granted, it won’t be a very feature-rich web app, but you have to start somewhere!
As usual, I’ve collected the code files for this instalment into a ZIP file which you can download here. As well as the ZIP file, I’ve also published a tagged release of the bartificer.ca.js code on GitHub which you’ll need for this instalment’s challenge.
Sep
15
PBS 39 of x – HTML5 Form Validation
Filed Under Software Development, Computers & Tech on September 15, 2017 | 2 Comments
In this instalment we’ll be taking a break from our parallel approach, and focusing almost exclusively on HTML5 form validation. We’ll dedicate the entirety of the next instalment to getting our cellular automaton prototypes up and running so we can actually ‘play’ the game of life.
While we won’t be continuing work on our Cellular Automata prototypes this time, I will share my solution to the challenge I set way back in instalment 36.
Also, before we get stuck into new content I’ll be taking a small diversion to explain a slight change in my approach to HTML coding, and how that will affect the sample code you see for the remainder of this series.
As usual, I’ve collected the example file for this instalment and the starting point for the challenge together into a ZIP file which you can download here.
Sep
1
PBS 38 of x – Taking Stock
Filed Under Software Development, Computers & Tech on September 1, 2017 | Leave a Comment
Since this is the first instalment back after our summer hiatus, it seems like a good time to pause and take stock. I want to look back to revise what we’ve learned to far, and, to look forward to where I want to take this series next.
Oct
28
PBS 24 of x – Creating a JavaScript API
Filed Under Software Development, Computers & Tech on October 28, 2016 | 4 Comments
In this instalment we’ll take our JavaScript skill up a level, learning how to write code that is designed to be re-used by ourselves or by others. When you solve a problem that you know you’ll need to solve again, it’s worth putting in a little extra effort to make your code as easy to re-use as possible. You may decide to share that code with others, or you may not, but either way, it’s in your interest to write it using some simple best practices.
Re-usable code without documentation is all but useless, so, we’ll also learn how to create great API documentation as you code. We’ll learn to do this using the free and open source tool JSDoc.
As a worked example, we’ll re-write our link fixer as an easily re-usable API, and while we’re at it we’ll also add in some extra functionality to make its behaviour more customisable, and hence, more useful to more people.
The sample files used in this instalment, as well as some needed libraries, can be downloaded as a ZIP file here. The examples assume you’ll save the files within the zip in a folder named pbs24
in the document root of your local web server.
Oct
12
PBS 23 of x – Creating Elements with jQuery
Filed Under Computers & Tech, Software Development on October 12, 2016 | 2 Comments
So far in this series we have been using jQuery to alter existing HTML elements by changing their attributes or style. In this instalment we take things to the next level, and learn how to use jQuery to create entirely new HTML elements, and inject them into the DOM, and hence, into the web page.
We’ll be working towards our first truly practical assignment in the series – a function that finds all links on a page, and if, and only if, they lead to an external page, alters them to open in a new tab, and appends an icon indicating that fact. In order to work up to that we need to learn five new things:
- How to build HTML elements with jQuery
- How to inject HTML elements into the DOM
- How to loop through each element represented by a jQuery object
- How to embed images directly into web pages using Data URLs
- How to use the 3rd-party library URI.js to interrogate URLs
There are four examples in this instalment, and a starting-point for the challenge. I’ve gathered them, and the other files they depend on, into a ZIP file which you can download here. It’s assumed that you’ll extract this ZIP file and place the five HTML files and one folder it contains into a folder named pbs23
in your local web server’s htdocs folder. The folder is particularly important because it contains a copy of the URI.js library, and if it’s not in the same folder as pbs23d.html
and pbs23-assignment.html
, those pages won’t work.
Sep
29
PBS 22 of X – jQuery Events
Filed Under Computers & Tech, Software Development on September 29, 2016 | 3 Comments
In the previous instalments we experimented with jQuery using the web console on our dummy page. In this instalment we’ll learn how to embed JavaScript into web pages, and, how to attach our code so it gets triggered by browser events.
This instalment includes a number of examples. You can copy-and-paste the code out of the page, but for convenience I’ve zipped up all the files and you can download them here.
Mar
17
PBS 11 of X – Tables
Filed Under Software Development, Computers & Tech on March 17, 2016 | 2 Comments
Finally, after many months of making Allison wait, it’s time to look at tables on web pages. We’ll start by describing the HTML markup for tables, and then look at how to style them with CSS.
Remember – tables are for one thing, and one thing only – displaying tabular data!
Mar
4
PBS 10 of X – Yet More CSS
Filed Under Software Development, Computers & Tech on March 4, 2016 | 4 Comments
Continuing our look at CSS, in this instalment we’ll start by looking at how to style lists, then we’ll move on to look at some more CSS selectors, and we’ll finish with an introduction to a new CSS concept – pseudo-classes.
Feb
19
PBS 9 of X – More CSS Positioning
Filed Under Software Development, Computers & Tech on February 19, 2016 | 4 Comments
In the previous instalment we learned how to group multiple HTML tags together to define regions within a page, and then how to move those regions around by floating them, or positioning them explicitly. We’ll start this instalment with a little revision – there was a lot to digest last time! While re-visiting the layout from last time, we’ll also look at some of its limitations, and then we’ll move on to look at the CSS display
property, how it can be used to alter layouts, and, how we can use it to improve on our demo layout.