vijayjoshi.org - php | javascript | ajax | and all things web

Archive for January, 2009

Create tinyurls in PHP using tinyurl.com API

January 28th, 2009 | Posted by Vijay Joshi | 2 Comments
For all those unfamiliar with tinyurl, it is a service thats lets you convert long urls into short ones. It is very popular and gets about 1.5 billion hits per ...

FAQ : How to toggle visibility of an html element by javascript

January 27th, 2009 | Posted by Vijay Joshi | No Comments
In my previous post, I discussed how we can change the style and/or css class of any html element by JavaScript. We can take advantage of this feature to add ...

Setting style/css class of html elements from javascript

January 24th, 2009 | Posted by Vijay Joshi | 8 Comments
Style of an html element can be set in 2 ways. Specify a css class name for the element. Set the style inline for the element. //Method 1: <p class="boldText">Some text</p> //Method 2: <p style="font-weight:bold;">Some text</p> Therefore ...

FAQ : Problem with javascript function parseInt

January 7th, 2009 | Posted by Vijay Joshi | No Comments
JavaScript function parseInt() is used to parse a string and extract the integer from that string. Therefore if you do parseInt(“200xyz”), it will return 200. The problem arises when you do the ...