Shaun Mccran

My digital playground


Dynamically adding markers to Google maps

Following on from a previous article I wrote about (Google maps panning the next step in my Google mapping project is to be able to add markers to a Google map dynamically.

This article deals with how to translate a location into a latitude and longitude using Google, and how to send and add markers from a database into a Google maps via a remote service, using AJAX and JSON.

There is a full example of the finished application here: Demo of dynamically adding markers to Google maps

[ More ]


Filtering a SELECT field using AJAX and JQuery

I've got a select form field, and I want it to change based on a search string that someone enters. Luckily for me the select field is dynamically driven from a database, so the most obvious way for me to do this is to make an AJAX post request using the string entered to amend the SQL query building the field.

This article shows you how to do this, there is a demo of the select field using AJAX here:

[ More ]


JQuery AJAX Http polling example

I've been using the JQuery post() and get() functions for a while now, and thanks to decent Blog entries from other community members I've got my head around the principles of seamless AJAX http requests and response handling.

This article examines a way of creating a polling AJAX http request. This is a request that will run every N seconds based on a value. It will hit a remote service and return a result, and display that result on screen.

View a full demo of an AJAX polling request here.

[ More ]


Cross site AJAX HttpRequest problems and how to create a Proxy handler

Most of us are familiar with the AJAX post() and getJSON() methods of remotely calling and passing around data, I use them with abundance when building applications. One thing I had not considered until recently is that all my AJAX Http requests are usually internal to that application, which also means they are on the same server and domain.

I recently jumped into a project where the application spanned 24 domains, and had been developed to use a core component library to help code re use. The problem with this arose when you are on one domain ( and you want to make a request to a different domain ( You encounter something called the 'same-Origin' policy.

This article deals with how to create a proxy to handle cross site AJAX http Requests.

[ More ]