PHP Developer / Blog

Posts Tagged ‘howto’

Have prototype.js automatically eval JSON responses

Wednesday, February 20th, 2008

JSON is the perfect format for passing data from a server to JavaScript. With the prototype.js the JSON string sent by the server is automatically evaluated to a native JavaScript datatype. In order to do this you need to pass the data back with a content-type of application/json.

Step 1
First we’ll need to set up a script (PHP in this case) on the server to return a JSON string and specify the content type. This is easily done using the following code: (more…)

Eliminate paging results by using JavaScript (ala DZone)

Monday, February 18th, 2008

I noticed that DZone had a really cool UI for a list of user submitted links. DZone is similar to Digg but geared more towards programmers. The premise is that a small subset of links are populated when the page loads. Once the user begins to scroll and nears the bottom of the list it automatically populates more stories to the end. This is a great alternative to having numerous pages that the user has to click through. You can also view a working example. (more…)

Solving “connection failure” for YUI’s asyncRequest

Friday, February 15th, 2008

Earlier today I was receiving a failure response when using YUI’s YAHOO.util.Connection.asyncRequest method to make an ajax call. The YUI documentation on this doesn’t help too much when troubleshooting the problem so we need to figure out what the heck is going on. (more…)

Closures - Demystifying Javascript’s secret weapon

Thursday, February 14th, 2008

Per Wikipedia, a closure is defined as “a function that is evaluated in an environment containing one or more bound variables“.

What’s a closure look like? (more…)


About this site:
This is my (Jaisen Mathai) personal site for potential employers who want to see my resume or portfolio. My ideal job would be to work as a PHP developer on a large scale consumer website. My experience is in using PHP, MySQL, Ajax and JSON. I really enjoy creative brainstorming...taking a problem apart and narrowing 100 solutions down to the best one.

Thanks for stopping by. Be sure to drop me a line.