DEANO.ME

Javascript

 

I have a very useful script for people who wish to monetize from the Google Affiliate Network. Are you sick of managing your banners manually? Adding/removing banners as you join/leave affiliates? Or are you looking to use Google Affiliate Network but the task of managing the adverts is putting you off? Well my Script can […]

 

So this is something I was implementing today. And as I usually do with these sorts off tasks, I did a search on Google to see if there were good/bad methods to accomplishing the task I required. However the first result (which had the best approach I could find) said “Don’t do this!!”. to me […]

 

Isn’t it annoying when you have a website that uses AJAX to load each page of the site, but the URL in the address bar just stays as the URL to the entry page to the site? Well it’s not just annoying its very user unfriendly too! Your users cannot hit F5 because that will […]

 

Recently I have been working on a project for work that allows customers to book train tickets and a hotel in one package (saving them money), how the system is working is the user first selects there train travel, after which they are shown all the hotels on a Google Map. This map also shows […]

 

Firefox (and perhaps other browsers) seems to have a bug when it comes to using the scroll wheel on an embedded Google Map. Quite often the page will also scroll when you use the wheel to zoom in and out, this is really frustrating and made worse by the fact it doesn’t always happen! I’ve […]

 

parseInt() is an incredibly useful function which is available in some form in all programming languages, however in JavaScript there is one slightly annoying difference… Unlike in other languages which either throw an error or just assume 0 when a string cannot be converted to an integer, parseInt() returns “NaN” which means “Not-a-Number”. This is […]

 

Those of you who are familiar with PHP know a very useful function called explode() which takes a string and a delimiter and splits the string into an array using the delimiter as the splitter. So for instance a string “this|is|a|test” can be split up into an array where: [0] =  this [1] = is […]

 

If your looking to find out if an element your about to select using ID, class and/or element type exists or not then you can do this using JavaScript, or if your implementing jQuery you may as well keep your code concise and use the jQuery method explained further down. JavaScript So here is an […]

 

Recently I needed to grab the users attention if they attempted to submit a form that had errors, now when the button is first clicked a box is shown with the error they must fix. But if they clicked the button again (in frustration because perhaps they had not noticed the error box appearing) I […]

 

A friend of mine named Porfirio Ribeiro once made this great set of functions to enable easy use of cookies from JavaScript. Hopefully some people will find this useful, feel free to re-use and re-distribute as long as you retain the original credit alongside any further credit if you modify or extend the functions. Here […]