Tag Archives: Dart

Dart Hackthon

If you have noticed, the last couple of my posts are around Dart, the new programming language which allows you to create web applications. It is because, last weekend, the Bangalore GTUG group organized a one day hackthon on Dart and I was part of the judging panel for the event 🙂

I started playing around with Dart for a couple of weeks now and so far, I kind of like the language, even though there are couple of bugs and some major features missing. That’s understandable since the language is still a technical preview.

Continue reading »

Posted in Events/Conferences, JavaScript/jQuery | Tagged , , | 2 Comments

Using YQL in Dart

I was exploring Dart, and wanted to create a small project using it to compare it with JavaScript. I was searching for ideas and then I thought of using YQL in Dart, to see how easy or difficult it is.

After poking around a bit, I found that Dart supports making Rest calls using XMLHttpRequest object, similar to JavaScript. I quickly tried to make a YQL call using that object.

The following is the bulk of the code. It is exactly how you do it in plain JavaScript.

URLEncoding

The only place I found a problem, was that Dart doesn’t have a URLEncoder yet. You have to emulate the URLEncoding done in JavaScript. I hope Dart gets its own URLEncoder soon.

Full source code

I have uploaded the full source code to github and added a couple of other examples as well. Check it out.

Posted in JavaScript/jQuery | Tagged , , | 10 Comments

URLEncoding in Dart

I was trying to use YQL from Dart and found that there is no way you can do URLEncoding using Dart.

I searched the dart:html, dart:uri and dart:io packages and found that none of them have the method to do URLEncoding.

I then posted about it in stackoverflow and then later found that, right now the only way to do URLEncoding is to emulate the encodeURL() function of JavaScript. Someone from Google has already done it. I just copied the file and placed inside my Dart project and then used the following line in my dart file.

#import("EncodeDecode.dart");

Although it works right now, I would really like to see this as part of the dart:uri package. Let’s see if someone from the Dart team is listening to this.

 

Posted in JavaScript/jQuery | Tagged , , | 5 Comments