Category Archives: JavaScript

(JavaScript) Google Maps API V3 Javascript Full Example

This javascript will create a complex google javascript map with multiple locations selected marked. The map will be centered in the middle and zoomed so that all point can be seen. It also stylizes the map making it mostly desaturated with bits of orange. More explanation as to how to set this up and change [...]

Posted in JavaScript | Tagged , , , , , , | Leave a comment

(PHP) auto complete like google suggestion

auto complete code snippet like google suggestions

Also posted in PHP | Tagged , , , , , , , | Leave a comment

(JavaScript) Stack implementation

Simple stack implementation for JS

Posted in JavaScript | Tagged , , , , , , , | Leave a comment

(jQuery) Get Latitude and Longitude using jQuery and Googles Geo Coding Service

Nice ajax function to grab the latitude and longitude of an address or postcode. Don’t forget your google key and address formatting.

Posted in JavaScript | Tagged , , , , , , , , | Leave a comment

(JavaScript) Observer-Pattern in JavaScript

Could be improved by passing an event instead of a simple payload.

Posted in JavaScript | Tagged , , , , | Leave a comment

(JavaScript) bubble sort

The bubble sort algorithm implemented in JavaScript

Posted in JavaScript | Tagged , , , , , | Leave a comment

(jQuery) jQuery input value text toggle

This is a jQuery custom function used for clearing the default input values of input fields without having to add a class or inline javascript like onclick or onblur. Just write your input and give it a value like you normally would and then add this function and you’re good to go.

Posted in JavaScript | Tagged , , , , , , , , | Leave a comment

(JavaScript) Bresenham’s Line Algorithm

Code obtained from a [stackoverflow question](http://stackoverflow.com/questions/4672279/bresenham-algorithm-in-javascript). This is a javascript implementation of the [Bresenham line algorithm](http://en.wikipedia.org/wiki/Bresenham’s_line_algorithm). Given two points, this function will return an array of coordinates which go from point A to point B, one step at a time.

Posted in JavaScript | Tagged , , , , , | 2 Comments

(JavaScript) Basic jQuery form validation

CSS: .error style the error class Form HTML: class=”required” makes the input field required minlength=”2″ makes the field require at least 2 characters

Posted in JavaScript | Tagged , , , , , , , | Leave a comment

Autocompletion with the jQuery autocomplete plugin

The jQuery autocomplete plugin allows developers to implement autocompletion for text input fields. Suppose you have a dictionary application. You might want to autocomplete words for a user to ease searching.

Posted in JavaScript | Tagged , , , , , , , | Leave a comment