Friday, May 16, 2008 by Admin
Table is a very common element used in web design. It can bring neat and tidy designs to web pages. As dynamic web pages(php, jsp, etc) are now very popular for web building, a lot of web designs involves filling up dynamic content into table cells designed in a template. However, since the contents are dynamic, we cannot expect how many data would be fitted into a cell. And if the table cell cannot fit all contents, browsers would simply change the size of the cell to display all contents by default. This is always a nightmare for web designers as all these could ruin the whole designed layout and resulting in a non-professional layout.
So, learning how to set the table cell size is a very important part for every web designer. This tutorial will tell you how to fix it. But what would happen if the content is really too much? Don’t worry, the tutorial will also tell you how to make a scrollable cell to ensure all the content in the cell are accessible.
[Read More…]
Posted in Css | | (2220 views)
Thursday, May 15, 2008 by Admin
As mentioned earlier, user input plays a big role on webpages. It acts as an interface between users and the server. Handling user inputs is important as we need to ensure what data can be sent to the server and we cannot expect what the user will send. One of the most common things need to be checked is the input strings.
Strings in javascript is not hard but also not easy to be managed. String is an object in javascript and so a lot of methods have been designed to manipulate it but on the other hand, as an input type, it provides the most freedom to users. As a result, checking is also the most complicated with text input type.
This time, we take the start and trailing space in text input as an example. Users, mostly casual ones, sometimes input strings with these whitespaces in the input boxes without caring. It does’nt look much difference in a glance. However, in the server side point of view, these start and trailing space does make a lot difference. For example, for a query request and database update request, these spaces can lead to failure of potential hits in the search and failure in finding the existing database entry. So, removing these starting and trailing space is a very common practice. It can be done on the client side when user submit the data.
Sounds good! Wait! Javascript object does’nt provide the trim function! So, how? Actually, it’s not hard to make one trim function by yourself. The following is one of the examples using javascript regular expressions.
[Read More…]
Posted in Javascript | | (1394 views)
by Admin
As the internet is getting popular, people want to interact with webs more easily. Html Form is the main way for users to interact with server side. It can bring a lot of functionalities to web sites such as searching, data storing and different kinds of calculations. However, page involving user inputs also implies users can do something to your page. The page would not know what data the user would give and unsuitable and unexpected data could bring undesired behaviors to the program, poor program could even crash with inappropriate data. As a result, the idea of input checking and validation is important if user input is involved.
[Read More…]
Posted in General, Javascript | | (299 views)
Wednesday, May 14, 2008 by Admin
A lot of web programmers would want a easy way to handle files on the client machine to suit their designs, for example, storing a temporary config file to be retrieved each time when users visit their site(which can be easily achieved by using cookies), setting a default upload file with the from file type to show user what to upload, etc. Some of them could be cool ideas, but how can you achieve these using javascript?
[Read More…]
Posted in Javascript | | (1309 views)
Monday, May 12, 2008 by Admin
By reading a forum post on 110mb.com, I realized I did some kind of things like this and would like to share the tips with you. Sometimes, web designers want to do some ‘fancy’ stuff on their pages, for example, toggle and allow the display of certain elements (say a form, or pictures).It not only provides fancy feeling to users, but could also make them feel a clear and simple layout. And here’s how you do it.
[Read More…]
Posted in Javascript, Css | | (5277 views)
Wednesday, May 7, 2008 by Admin
So after I got a bit familiar with the Fackbook APIs and FBML stuff. I suddenly got an idea to place my gamecard of my Xbox Live account into the facebook profile so that someone I know could see I am a live user and add me to their friend list. To be fair, I also set users to put Wii friend code and PSN Ids in the profile too. But since they got no official gamecard, I can only display the ids given. This app is pretty simple, which only includes a form for user inputs and the profile_setFBML() function, which allows the app to set a FBML into the user profile’s application box. To bad the fb:iframe is not allowed in the profile and so I cant use the official gamercard.xbox.com but borrow pictures from mygamercard.net instead. If you want to show your game tags and game cards to your friends, you can try it out at
MyGameTags
Posted in General, Facebook | | (350 views)
Sunday, May 4, 2008 by Admin
Yeah, so I spent quite some time to read about those facebook FBML and API stuffs (not during office hours!!! lol ) and finally made a simple facebook web application. It’s just a simple game of Rock Paper Scissors. I just completed the parts to make it functional and editional features such as leaderboards will be added at a later time.I do not expect a lot of people would add it but letting my friends to play with is happy enough for me. :)
If you guys wanna try out this app, you can visit Rock Paper Scissors
I will post some simple techniques on developing facebook apps when I have time. =)
Posted in General, Facebook | | (333 views)
Sunday, April 13, 2008 by Admin
So I finally face a challenge.
The Facebook library need the json library, which is only available in PHP 5.2.
But 110mb is running PHP 5.1.6, so I cannot use it at all!
Fortunately, I found out someone did a wrapper class to help someone like me!
http://www.boutell.com/scripts/jsonwrapper.html
It is based on M. Migurski’s PEAR JSON library and is furture compatible as it would not run if PHP 5.2 is being used.
Thank you, now I can proceed.
Posted in General, Php | | (177 views)