There is a Swansea but to get there you’ll probably need a map … a Google Map. So here are some quick examples to get you started. All of the following use Google Maps Version 3. Adding a Google Map means adding some Javascript to your page and accessing the Google Maps API. Note: When…
Read MoreEver needed to replace all the instances of a string in Javascript (or ActionScript)? This function takes three parameters, the string to find, the string to replace it, the string to search and an optional setting to toggle case sensitivity. Syntax .replaceAll(target:string, findToRemove:string, replacement:string, [caseSensitive:int=0 ]) Example function call searching the string “Bob, bob and…
Read MoreThis seemed to take a disproportionate amount of digging to find. So for future reference here is a neat Javascript number formatting function that adds commas to large numbers. Was found at http://www.mredkj.com/javascript/nfbasic.html
Read MoreWhat is JSON? JSON is Javascript Object Notation is a lightweight way to store and move data. If you are familiar with XML think of JSON as been … fitter, happier, more productive. So what is a Javascript object. Javascript objects consist of name : value pairs. They are defined within curly bracket as follows:…
Read MoreThere are two flavours of each(). It can be used as selector to grab ‘each’ instance of a selector or it can be used to loop around objects like arrays. Usage 1: Looping Elements in the HTML We can use each() as a Selector. Assume we have a simple list: Then with each() we can…
Read MoreWith the likes of jQuery you often have the need to create callback functions. These can be anonymous / inline or named functions. Here is quick post to show the syntax differences between the two. Anonymous Here is an anonymous or if you prefer inline function. The function isn’t named and we get straight into…
Read MoreShould I Split or Should I Join Now or Should I Array I Should I Go Now. Oh dear. Shoehorning the Clash to a Javascript tutorial – phew rock ‘n’ roll. Arrays are a neat way of moving and manipulating data. To create an array in Javascript the syntax is as follows: Or if you…
Read MoreIt is getting to that time of year again. Digging around in the attic I found an old-fashion Flash/Actionscript snow storm. Oh Happy days … but as it is 2011 what we really need is a HTML5 snowstorm. http://www.mustbebuilt.co.uk/demo/html5/canvas-snow.html Here is breakdown of the code. First you need a canvas. To use this canvas element…
Read MoreAdobe Edge, available in beta, is a ‘post Flash’ animation tool. It generates animations constructed with web standards HTML5, CSS3 and Javascript (mainly piggy backing on jQuery). The interface is very familiar to Adobe After Effects in terms of the timeline and property keyframes. In terms of functionality it has the lightweight options for adding…
Read MoreLoads of news coming out from Adobe this week as they hold their Annual Beanfeast MAX. There was the obligatory Photoshop pixel fairy magic. The one that got people most excited appeared to be the ‘deblur’ tool. Expect this to replace the Content Aware Fill as the killer Photoshop demo to wow your audience. But…
Read More