Monday, December 31, 2012

Add a Background Music (MP3) to your Blogger

Here's the simplest method (HTML/JavaScript Widget/Gadget) I can find: <object type="application/x-shockwave-flash" data="https://sites.google.com/site/blogknol/blogknol/dewplayer-multi.swf" width="240" height="20" id="dewplayer" name="dewplayer"> <param name="wmode" value="transparent" /><param name="movie" value="https://sites.google.com/site/blogknol/blogknol/dewplayer-multi.swf"...
Read More »

Sunday, December 30, 2012

Javascript Mouse Wheel Event Handler

I found several examples online but none of it works 100% as expected. I sort of modified them and came out with the version which works 100% for me on Chrome, IE, Safari and Firefox. Here it is: var ff = (navigator.userAgent.indexOf("Firefox") != -1); if (ff) {   mousewheelevent = "DOMMouseScroll"; } else {   mousewheelevent = "mousewheel"; } if (document.attachEvent) {   document.attachEvent("on"+mousewheelevent, catchWheel); } else if (document.addEventListener)...
Read More »

The Death of Web Page ...............???

Ever since the social network pages such as Facebook, Twitter and Linked'in came into picture, the demand of conventional web pages are slowing down. Especially blogs, you'll see less and less new blogs or many blogs are switching over to Facebook pages. Additionally, with the mobile apps getting more and more popular, web pages take another hit. Web users nowadays prefer Facebook and mobile...
Read More »

Is It The End of Javascript?

Since almost all of our javascript codes can be replaced by jQuery equivalent, do we still need Javascript? The answer is yes and no. Yes, if you want to place dynamic HTML content in a controlled page such as Ebay. Ebay doesn't allow the call to an external javascript such as the jQuery library. You have no choice but to switch back to conventional javascript for actions. For me, I would encourage...
Read More »

Tuesday, December 25, 2012

Pre-fill Text Input Box with Grey Text using Javascript

I don't know since when the pre-filled grey text in the text input box becomes so popular. Here's what I do. I hope these are the simplest codes. Enjoy! The Javascript & HTML: <script> function checkText(action) {   if (document.getElementById('myTextID').value == 'Default Text' && action == 'focus') {     document.getElementById('myTextID').value = "";   }   else if (document.getElementById('myTextID').value ==...
Read More »

Friday, December 21, 2012

Render Text in PNG Format using PHP GD2 in IIS Environment

The following example won't work if you are running GD version 1 in your PHP server. Some modications are required to make it work. GD's imagettftext by default cannot set the spacing between characters. If you want to force spacing between characters, you can display each character at a time calculating the spacing your self using a loop. However, there is one problem setting the spacing: each...
Read More »

Sunday, December 16, 2012

Check Out Facebook Friends with Specific Birthday Month FQL

As in my previous post, here's the modified version to list out friends with birthday in the month of May in Facebook. SELECT name,uid,birthday_date FROM user WHERE uid IN (SELECT uid1 FROM friend WHERE uid2=me()) AND strpos(birthday_date,'05') = 0 You can change the month (highlighted in blue) to some other value...
Read More »

Saturday, December 15, 2012

Check Out Facebook Friends with Most Mutual Friend FQL

As in my previous post, here's the modified version to list out friends with most mutual friends in Facebook. SELECT name,uid,mutual_friend_count FROM user WHERE uid IN (SELECT uid1 FROM friend WHERE uid2=me()) ORDER BY mutual_friend_count DESC ...
Read More »

Check Out The Seniors Among your Facebook Friends Using FQL

As we know that we are all assigned an ID as we signed up a Facebook account. The account grows bigger as time goes by. We can tell from this little hint who signed up the FB account earlier by comparing the user ID. Here's the FQL used to generate the list according to the time first joined the social network: SELECT name,uid FROM user WHERE uid in (SELECT uid1 FROM friend WHERE uid2=me() ORDER BY uid1 ASC) As in the earlier post, you can try out this FQL query here: ...
Read More »

Friday, December 14, 2012

Check Out Facebook Friends with Most Friend FQL

Here's a fun FQL to find out who among your FB friends has the most friends: SELECT name,friend_count,mutual_friend_count FROM user WHERE uid in (SELECT uid1 FROM friend WHERE uid2=me()) ORDER BY friend_count DESC Just copy and paste from the above query codes and paste it to: https://developers.facebook.com/tools/explorer I also added the mutual_friend_count for more fun. You...
Read More »

Sunday, December 9, 2012

jQuery: Dim an Entity and Hide it

Make sure you call the jQuery library before running any jQuery functions. Either library version is fine, Google or jQuery Foundation. The following shows the code to dim the myDiv to 0.1 opacity within 500ms. After that, hide the DIV: $('#myDiv').fadeTo(500, 0.1, function() {   $('#myDiv').css({visibility: "hidden"}); }); If you straight away animate the opacity to 0 without hiding the DIV, the DIV will stay there although it is not visible nor it is hidden. If the...
Read More »