Monthly Archives: Novembre 2009
Truncate string preserving some words in PHP
When you search in Google for a string, Google highlights with bold text the words you’ve searched in the results…
Click links with JavaScript
If you want to click on objects, anchors, table cells or any other html element to emulate the javascript behaviour…
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…
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…
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,…
Cross browser opacity
Is there a css definititon to make cross browser opacity? Yes. I found this, and it seems to work: If…
PHP Day add function
How to add 2 days to a date in PHP? There are many ways to add days to a string…
ASP equivalent to PHP Ucfirst function
This code does the same thing that Ucfirst function makes in PHP. “Ucfirst” means “Uppercase first letter”. ASP doesn’t have…
ASP equivalent to PHP ereg_replace function
I’ve used so many time the php function ereg_replace that when I have to use ASP (‘cause sometimens you have…
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…
Do spelling using google spell checker
If you have a user input that may contains some error you can try to check the spelling using Google…
Parse a float number in javascript
This small code parse a javascript float number to a string. It converts the number to a string and let…
Phoogle Modified Class for Google Maps
I was looking for a php class to use on Rockit.it to geo reference band, festivals, labels and other stuff.…
Make square thumbs or cropped thumbs with php
This is a thumb generator php class. I’ve been searching a lot for some code to make good thumbs on…
Stop UTF8 problems with special characters
I’m italian and I always need to use special chars like è é à ù. The same need belongs to…
Execute Scalar and Execute Row for Php
A couple of simple functions thar returns the first value and the first row of a result set. Very usefull.…
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…