Category: web programming

Web programming: the immediately invoked function expression (IIFE)

Self-tutoring about web programming: the tutor brings up IIFE. It’s been my experience that a function need be called to run, but perhaps not always. Apparently, in JavaScript, the construction (function(){ // function code lines // })(); will run spontaneously.

Programming: line numbers in Notepad

Tutoring programming, you might still use Notepad (I do). The tutor shares an observation. Some text editors have the option to display line numbers, so you can see the exact line you’re on. Since compilers often mention problems in code

Tagged with:

Perl programming: printing a string

Tutoring web programming, you might encounter a question about Perl. The tutor mentions an observation. Because inline styles use quotes, and then of course printing a string often uses quotes around it, a situation can easily develop in which nested

Tagged with: , , ,

Web design: CSS properties vs html attributes

Tutoring, definitions are important. The tutor shares the difference between CSS properties and html attributes. A CSS property is something you change to affect the appearance of an element. For instance, the color property can be set to the color

Tagged with:

Web programming: JavaScript: avoiding the self-closing script tag

Tutoring web design, this fact is known. The tutor shares some documentation. I’ve known for some time that the self-closing script tag <script src=”the_script.js” /> seems not to work. Rather, I use <script src=”the_script.js”></script> I’ve wondered why the self-closing script

Tagged with: ,

Web programming: AngularJS, part 2

The tutor shows an example of AngularJS in action, with JavaScript’s Math.pow(x,y) function. JavaScript’s function Math.pow(3,4) evaluates 34, giving the answer 81. In that expression, 3 is the base, while 4 is the exponent. Below, you can input a base

Tagged with: ,

Web Programming: JavaScript: how to manage a multi-line string

The tutor tells a trick for printing long strings with JavaScript. Suppose you have a long string, over many lines, that you want to print with JavaScript. Typically, to print a string, you might assign it to a variable, then

Tagged with: ,

Web design: a JavaScript wrapper for SVG in WordPress

The tutor shows an example of a wrapper program in action. To my knowledge, a wrapper is a program that hides a function that the managing system can’t handle. The “wrapping” is code that the managing system recognizes as the

Tagged with:

Web design: y=sinx from jsDraw2DX

The tutor shows how to produce a graph of sinx on a web page using jsDraw2DX. I’ve mentioned jsDraw2DX in a couple of posts (here and here). For producing a graph of sinx, the basic construct is var singraph =

Tagged with: ,

Web programming: the “auto” setting

The tutor talks a bit about “auto”: is it the default setting for layout? I’ve read that “auto” is default: unless you set the property to something else in particular, the element will be rendered as though that property was

Tagged with: , ,