Friday, October 10, 2008

Javascript MVC

I found two frameworks that allow you to develop application that follows MVC pattern in Javascript.
Personally, I like TrimJunction, a part of TrimPath. Moreover, it supports gears synchronization.

http://javascriptmvc.com/
http://code.google.com/p/trimpath/wiki/TrimJunction

Tuesday, October 7, 2008

JSON

JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is based on a subset of the JavaScript Programming Language. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language.

JSON is built on two structures:

* A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.
* An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.

Go to http://json.org/ to see more. It has a small library that is quite useful for build web 2.0 to convert from json to text and vice versa. This is useful for sending data using json format as data exchange.

Thursday, October 2, 2008

Experimenting Google Maps with Local Files

I found one link, and I just quote it from http://cafe.elharo.com/web/google-maps-tip-1-experimenting-with-local-files/:

As you probably know using Google maps on a web site requires a custom API key that is locked to the web site. For example, my key is ABQIAAAANzhjmjn_aQro8IDfoVHCkxT-n61mIiazNPHwWTk3s75Ar5J1YhQDxyPhUR-O4Nfg_1iRn1pAUseY4g and every page that uses a Google map includes this script element:

<script src="http://maps.google.com/maps?file=api&v=1&key=ABQIAAAANzhjmjn_aQro8IDfoVHCkxT-n61mIiazNPHwWTk3s75Ar5J1YhQDxyPhUR-O4Nfg_1iRn1pAUseY4g" type="text/javascript"></script>

I’m not giving away any secret by telling you that. You could figure out the same thing using View Source. However. the key is locked to the web site. If you try using that key on a different site, the map won’t load.

This is all well and good. However it’s very inconvenient for debugging, testing, and experimenting, because you can’t load a map on your local file system. Everything has to be tested on the live Web server. You could probably password proterct a directory to play around in, but what a pain.

It turns out that you can use this script element on your local hard drive:

<script src="http://maps.google.com/maps?file=js" type="text/javascript"></script>

Then you can test out and play with Google Maps without loading the file onto the production web server first. Cool!

Subscribe in a Reader