javascript

The Quantcast CMP broke my sites

A javascript error in CMP blocks my site.

Maggio 19, 2023

Scroll to DIV by ID without jQuery

Use scrollIntoView instead of jQuery animate.

Dicembre 16, 2022

React links

Collection of links and notes while approaching React.js, next.js and related topics.

Dicembre 14, 2022

Add Internet Explorer class to body to detect old browser

When you have clients that still uses an old browser, you need to handle it. This javascript function detects the…

Febbraio 27, 2017

Modify list counter in :before pseudo class with jQuery using start attribute

Suppose you have two ordered list ol tags, and the second one has a start attribute. You also have in…

Aprile 20, 2016

Refresh a Google Adsense banner with Javascript

Often bloggers and site owners use galleries to have a greater number of pages, adding pages means adding clicks. Each…

Novembre 9, 2013

Detect if is mobile with Javascript, read user agent

How to detect if your user is using a mobile device in Javascript? You can do it by checking the…

Novembre 5, 2013

Unobtrusive javascript to add an overlay banner

If you have to add an overlay to a site, here is a fast way to do it with an…

Novembre 7, 2011

New Facebook Invite all friends hack

So, you want to invote all your friends but the old hack doesn’t work anymore? With the last facebook friends…

Settembre 14, 2011

Get URL parameter in javascript

Sometimes in javascript you have the variable that you need to use in the url, as a parameter passed in…

Novembre 25, 2010

Get file name in javascript

How to get the file name of the page? When you need to read the file name of the current…

How to write a text description into html input type password

Sometime designers put form labels and instrucions into html inputs. One of the common uses is for login boxes when…

Marzo 10, 2010

How to capture enter key pressed in a form (JavaScript)

Suppose you have a login form and you want to send the form when user press enter on his keyboard…

Febbraio 16, 2010

Decimal Degrees conversion and distance of two points on google map

Those two functions are usefull when you’re making Google Maps applications: When you show the coordinates of a point, it’s…

Dicembre 26, 2009

Javascript Ruler for Google Maps v3 to measure distance on map

Javascript example for measuring distances on a Google Maps with a ruler.

Dicembre 19, 2009

Mini gallery/slideshow with PHP and JQuery

Sometimes I’ve had to quickly put in a page a simple slideshow, the first times I’ve searched a lot around…

Dicembre 13, 2009

Clustering many markers with Google Maps v3

I’ve found this blog where Matthias Burtscher converted the Marker Cluster (like the Phoogle2) for Google Maps API v.3. Since…

Click links with JavaScript

If you want to click on objects, anchors, table cells or any other html element to emulate the javascript behaviour…

Novembre 18, 2009

Set “write here” on input type text?

If you are using JQuery framework and you want to set up the default value of some text box in…

Novembre 17, 2009

How do I print the elements of an object in Javascript?

This function is similar to the print_r php function: it runs over the elements of an object recursively and put…

Full Screen GControl for Google Maps

Use with phoogle modified class: (see an example here) To use it in the phoogle modified class just turn it…

Novembre 13, 2009

How do I get the value from a combo in Javascript?

If you don’t use any javascript framework such as jquery.js or prototype.js the combo object isn’t so easy to use,…

OnKeyUp Fix Alphanumerical Chars

When you have an html form and you want only alphanumerical [a-z0-9] chars in your input, you can use this…

Novembre 10, 2009

Javascript to make some links blink

Mark each anchor tag (<a href…) with rel=”blinking” to make the tag blink (not very clever, but sometimes useful). This…

Novembre 9, 2009