Tag Archives: Postaday2011

Facebook Javascript SDK – A Simple Login Page

 
Update 2012-01-13: For OAuth 2.0 implementation, please refer to the new post.
Facebook Javascript SDK – A Simple Login Page with OAuth 2.0

Update 2011-12-19: Since Facebook has updated their authentication system and HTTP to OAuth 2.0 and HTTPS. The following example will not work any more. i will update the post later. For more information, you can refer to Jerry Cain – Updated JavaScript SDK and OAuth 2.0 Roadmap

 

Facebook API allows your website to interact with the Facebook content. A very common usage is to authenticate a Facebook user to your website. Let’s try it now.

1. Create the a Facebook App @ Facebook Developers.

2. Enter the website URL under Select how your app integrates with Facebook.

3. Upload the following file to your web server. This file should be located at the URL which we enter in step 2.
fb-login.php Continue reading Facebook Javascript SDK – A Simple Login Page

jQuery & JSON – Make JSON POST request using jQuery.post()

We can also make JSON POST request using the jQuery.post() function. If you want to use GET request. please refer to the previous post.
jQuery & JSON – Make JSON GET request using jQuery.getJSON()

 
Update @ 2011-10-13: This example does not work for Cross Domain POST request since the Current jQuery version(1.6.4) does not allow a Cross Domain POST request. For more information, you can refer to Mark Needham – jQuery: $.post, ‘jsonp’ and cross-domain requests

So if you want to make a Cross Domain GET request. Take a look on the following post.
jQuery & JSON – Make Cross Domain Request Using jQuery.getJSON() with JSONP

 
Here is the new server.php Continue reading jQuery & JSON – Make JSON POST request using jQuery.post()

jQuery & JSON – Make JSON GET request using jQuery.getJSON()

The following example makes a HTTP GET request with a JSON input and return the corresponding JSON object.

 
Update @ 2011-10-12: The example here does not support cross domain request. In other words, the server.php and json-get.php have to be inside the same domain. (ex. localhost) Thanks dskanth for pointing out the problem.
jQuery & JSON – Make Cross Domain Request Using jQuery.getJSON() with JSONP

 
Add the following 2 files to your web server
server.php Continue reading jQuery & JSON – Make JSON GET request using jQuery.getJSON()

另一半的翅膀

作者: 深雪

月夜遺留了死心不息的眼睛比較,這書才是我心所想像的愛情小說。

女主角Wise有著女強人的強烈性格,因為太過自戀而找不到心中理想的對象,其實這也不懷。

直到一天天使讓她知道因為前世與另一半承諾不再分離,今世就成為同一個人,天使便將Wise一分為二,好讓她跟自己Self戀愛…

書中內容跟作者在散文中所描述的愛情觀都很接近,男女主角旅行的地點 Mykonos 我也曾到此一遊,我想作者也很喜歡去旅行吧。 XD