javascript

Fault tolerant loading remote javascript with YUI

The registration form of the MyOwnDB app was simplified this week, but an information I wanted to keep is the country where registered people are located, notably to know which translation of the UI to provide next (currently, it looks like it will be spanish).

I decided to use the Geoplugin.com service, but it appears it's unreachable at this time, making for a less than engaging experience when loading the sign-up page.

CSV import and API: 2 news features!

Two new features have been rolled out, both having to do with getting data in and out of MyOwnDB. We're very excited about this! It is now possible to import data from a CSV file through a very simple procedure:
  1. upload your CSV file
  2. link columns in the CSV file to fields in your database table
  3. get an overview of the import: number of rows imported and number of rows rejected
Rows can be rejected due to data validation exceptions, for example:
  • trying to import text in an integer field
  • trying to import an invalid email add

YUI-ext grid and context menus

I recently had the opportunity to use YUI-Ext for a little application. I'll focus on the creation of the context menus for the grid. If you're discovering YUI-Ext's layout approach, more information is available from Jack Slockum's blog in Exploring Cross-browser Web 2.0 Layouts with Yahoo!

Understanding javascript's prototype member

After looking Douglas Crockford's talks about javascript, I started experimenting to really understand javascript's prototype. If you have downloaded the presentation's slides, this is an illustration of slide 27. I've worked with the javascript interpreter included in the JDK6, based on Rhino. If you do this, just run $JAVA_HOME/bin/jrunscript and you get a prompt of the javascript interpreter. Each javascript function is given a prototype member when it is created.

Enhance your javascript knowledge online!

Until now I've been using javascript as a simple language to get Ajax features, but as I used it I discovered interesting features and got really interested to know more. As the JDK 6 has rhino included, you can also use javascript and get access too all Java libraries, which makes javascript knowledge even more interesting. A really great resource to know more about the power of javascript and how to use it effectively is the series of presentations by Douglas Crockford made available online by Yahoo.

Javascript closures illustration

Jack Slocum mentioned in a comment the problem comes from the creation of a global variable. When you create a local variable, you don't get the problematic behaviour. Thanks Jack for taking the time to correct me.

Intro

Here is the illustration of a bug that was present in version 0.1 of the yui slideshow.

YUI based slideshow

As I wanted to add a slideshow on the MyOwnDB homepage, I started looking for a ready made solution, but as I didn't find exactly what I wanted, but also because I was curious of how it could be done, I started coding one based on YUI.

Remember to reset the YUI listeners on updated content

I had event listeners set on elements added dynamically to the page not working:
my original content Click here to replace content
When you click on the test_link, the content of the div is

File uploads to Amazon S3 the AJAX way thanks to Dojo

File uploads are finally deployed! You can now specify in MyOwnDB that a detail of your entity is of the type "file". This will let you attach a file to an entry, and subsequently replace or delete it. This required some changes in the application, more specifically in the way the forms are submitted back to the server. For a file upload to work fine, you have to send it with the enctype attribute set to "multipart/form-data". But that's not all! You cannot just serialize the form in javascript like you can do with other input types because you cannot access the file from Javascript.

Use of Yahoo UI's tooltip and overlay

Monday has seen a big update of the signup code, with, amongst other changes, the use of the Yahoo UI libs. Although prototype is well integrated with rails, Yahoo's extensive documentation and the praise it got from some leading javascript developers got me interested, and I must say I wasn't disappointed. When you download the distribution and uncompress it, you get a directory structure.
Syndicate content