Notes after three years of using AdSense
When I first added AdSense ads to this blog, I had no idea what to expect. After three years, I would have to say that the results have been mixed, but overall I’ve found that
Continue readingSolving technology problems, one at a time
When I first added AdSense ads to this blog, I had no idea what to expect. After three years, I would have to say that the results have been mixed, but overall I’ve found that
Continue readingHave you ever tried to use a javascript to modify the properties of a frame? Particularly a javascript ON the frameset page? If you have tried, you probably know that timing plays an important role.
Continue readingJavascript is a loosely typed language, which means it is possible to define a variable without specifying what type of data it holds (string, integer, floating point, etc.). This can cause problems if you think a particular value is a number when in fact it is a string. A string must be converted to a number to use it in calculations.
For example, when working with SCORM elearning software, scoring and performance data is stored in a Learning Management System as strings. If you need to do calculations with the data after retrieving it, the string data must be converted to integers or floating point type.
The parseInt() function can be used for this purpose. It parses a string and returns an integer. However use of the function without understanding the details can lead to unexpected results. If your string begins with a zero, the number will be evaluated in octal instead of decimal system. In Octal, 08, 09 are not valid numbers, and 010, 011, etc. will not represent the same values as they would in decimal system.
Continue readingWhen developing an xml-based application, you may come across the need to include HTML data in xml nodes. The problem is that unless this data is escaped in some way, it is interpreted as xml and will cause a malformed structure. The easiest way I’ve found so far to use a CDATA attribute to escape the code automatically. Then, when you are creating an xsl fragment to edit or display the data, use
Continue readingSuppose you want to use the value of one variable as part of the name of another variable, but you don’t know the exact name of the first variable, because it will be selected by user input.
Continue readingHave you ever wanted to assign a function to an onload or onclick event, based on some condition or even from another page? A project where this came in handy was a multi-page learning module.
Continue readingFlash video has several advantages over other formats, especially the fact that the Flash plugin comes pre-installed on most browsers. For this reason I’ve been looking at using streaming Flash video in sites which must support a wide variety of browsers and platforms.
Continue readingWhen building web applications I often use display styles to show or hide divs or table rows as needed. On one project, I found that the “colspan” property did not seem to work in Firefox or Safari. This was because I had incorrectly used display:block to style the TR element, instead of display:table-row. A demo is below, and the code follows.
Continue readingWhile working on a php insert-record form I was getting the error: #1062 – Duplicate entry ‘127’ for key 1 although there were no other records with the id “127” – just the latest one.
Continue reading