Archive for the ‘AJAX’ Category

Translate easily with JavaScript and the Google language API

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 4 out of 5)
Loading ... Loading ...
Wednesday, March 26th, 2008

wow, google recently released an API for their translation services called Google language API. Thats a good news but it even gets better! The api is really easy to use and applications can be boosted within minutes. The reference can be found here

Here is a quick example of how to translate something...

JAVASCRIPT:
  1. google.language.translate('my mum is swimming', 'en', 'de', function(result) {
  2.   alert(result.translation);
  3. });

and it gets better and even easier: its possible to let the API detect the language .. so nothing you have to take care about anymore.

JAVASCRIPT:
  1. google.language.detect('Deutsch ist auch eine Sprache',
  2.  function(result) {
  3.   alert(result.language);
  4. });

Further reading: An introduction to the language API and translation tools.

Now its time to come up with some nice little tools, widgets which use this service. "a user selects a paragraph an your page, clicks a button and suddenly the text is translated into the desired language".

ajaxed 0.3 released

1 Star2 Stars3 Stars4 Stars5 Stars (8 votes, average: 4.88 out of 5)
Loading ... Loading ...
Tuesday, December 18th, 2007

i have updated ajaxed (classic asp ajax library) to its 0.3 version. Thanks to all contributors who helped me with their feedback. Here are the updates... (more...)

ajaxed: Calling server side VBScript procedures from client side (equivalent to PHP xajax)

1 Star2 Stars3 Stars4 Stars5 Stars (45 votes, average: 4.58 out of 5)
Loading ... Loading ...
Monday, July 2nd, 2007

My last post (about an ASP RSS component) included a demonstration which made use of a cool ajax technique simply called "ajaxed". See the demonstration here again. If you play around you will recognize that there is no conventional postback and AJAX is up in here ;) I have developed a small "library" which easily allows you to call server side ASP VBScrtipt procedures from the client side. No low-level Ajax knowledge is required... (more...)

Generate JSON from VBScript (ASP) datatypes

1 Star2 Stars3 Stars4 Stars5 Stars (62 votes, average: 4.45 out of 5)
Loading ... Loading ...
Thursday, April 26th, 2007

When working with JSON it's nice to have a generator for your language which transforms all the datatypes from your chosen programming language into the JSON grammar so that you can use them within javascript. For a lot of popular languages it's done already (i suppose) but I haven't found one for classic ASP .. so here it comes. The following example quickly demonstrates what the goal is:

ASP:
  1. set RS = getRecordset("SELECT * FROM table")
  2. response.write((new JSON).toJSON("rows", RS))

A simple usage of JSON normally is that you create a page which outputs data as JSON as the only response. This page is called later from another page and the returned data is used within a javascript function (known as callback). So the snippet above gets some data from the database and stores it in an adodb.recordset which is passed then to the JSON generator and the result is printed on the page. The consuming page would like to access the data now as it originally was within the recordset. like this:

JAVASCRIPT:
  1. function callback(rows) {
  2.    for (i = 0; i <rows.length; i++) {
  3.       alert(rows[i].columName);
  4.    }
  5. }

read on to get the details... (more...)

JSON character escaping function in classic ASP

1 Star2 Stars3 Stars4 Stars5 Stars (13 votes, average: 4.23 out of 5)
Loading ... Loading ...
Thursday, April 26th, 2007

If you are into advanced AJAX techniques you probably will stumble across JSON (www.json.org) which makes developing (and therefore the life) a lot easier when working with AJAX. If you already stumbled across and you use JSON within classic ASP you might find this article useful. It deals with escaping characters for JSON acording to the RFC4627#2.5 (more...)