You searched for: 'native'

Monday, June 18th, 2007

Firefox 3: SQLite and more

Category: Firefox

Firefox 3 is to support SQLite for offline storage. The new alpha release tells us this and a lot more (below).

The world of the RDBMS has come to the browser, and has jumped from server to client in the Web platform.

  • Bookmarks portion of Places has been enabled
  • New crash reporting system, Breakpad. It’s
    enabled by default on Mac OS X, on about 50% of Windows installations, and not yet available on Linux.
    You can also view crash reports at this site.
  • New Javascript-based Password Manager. More details available here.
  • Support for Growl notification under Mac OS X
  • Support for native controls on Mac OS X
  • Miscellaneous Gecko 1.9 bug fixes

Posted by Dion Almaer at 8:10 am
11 Comments

++++-
4.1 rating from 33 votes

Wednesday, June 13th, 2007

A JavaScript Module Pattern

Category: Articles, JavaScript

Eric Miraglia, of Yahoo!, has documented his explanation of what Douglas Crockford calls the JavaScript Module pattern.

Eric discusses the steps:

  • Create a namespace object: If you’re using YUI, you can use the YAHOO.namespace() method
  • Assign the return value of an anonymous function to your namespace object
  • Add “private” methods and variables in the anonymous function prior to the return statement
  • Do something useful with the pattern
javascript

  1. YAHOO.myProject.myModule = function () {
  2.  
  3.     //"private" variables:
  4.     var myPrivateVar = "I can be accessed only from within YAHOO.myProject.myModule."
  5.  
  6.     //"private" method:
  7.     var myPrivateMethod = function () {
  8.         YAHOO.log("I can be accessed only from within YAHOO.myProject.myModule");
  9.     }
  10.  
  11.     return  {
  12.         myPublicProperty: "I'm accessible as YAHOO.myProject.myModule.myPublicProperty."
  13.         myPublicMethod: function () {
  14.             YAHOO.log("I'm accessible as YAHOO.myProject.myModule.myPublicMethod.");
  15.  
  16.             //Within myProject, I can access "private" vars and methods:
  17.             YAHOO.log(myPrivateVar);
  18.             YAHOO.log(myPrivateMethod());
  19.  
  20.             //The native scope of myPublicMethod is myProject; we can
  21.             //access public members using "this":
  22.             YAHOO.log(this.myPublicProperty);
  23.         }
  24.     };
  25.  
  26. }(); // the parens here cause the anonymous function to execute and return

Note that this technique is very generic, and you can do the same thing with other frameworks, or without any frameworks!

Posted by Dion Almaer at 6:01 am
19 Comments

++++-
4 rating from 52 votes

Monday, June 11th, 2007

Safari for Windows, Ajax on iPhone

Category: iPhone, WebKit

Safari 3 Beta

Steve Jobs gave the keynote at WWDC this morning, where he announced a couple of items that affect Ajax developers.

Safari for Windows

Apple is releasing the public beta of Safari for Windows today. Steve gave demos of Safari, claiming that it screams:

  • ibench html performance: IE 4.6 sec, FF 3.7, Safari 2.2 seconds
  • javascript: IE 2.4 sec, FF 1.6, Safari 0.9 seconds

WebKit is getting a real solid foundation on Windows with Apple joining Adobe on the Windows port. I bet Adobe is happy.

iPhone Development

Scott Forstall, VP of the iPhone Division, showed off a corporate address book database application using LDAP. It looks like a native iPhone application. The card looks the same as the address book. You can direct dial from the application, email, display a map (can tie directly into the built-in Google Maps application on the phone), and more.

Since this is all on Safari, I wonder what plugins are available too.

Great to see that the SDK for the iPhone is Ajax. We all know that ;)

Posted by Dion Almaer at 1:26 pm
68 Comments

++++-
4.4 rating from 67 votes

Tuesday, May 22nd, 2007

210 Ajax Frameworks and Counting

Category: Framework, Library

A year ago, I posted this article showing a count of 134 Ajax frameworks, according to the frameworks area on AjaxPatterns.org.

Today, a recount shows there are 210 Ajax frameworks and libraries listed on the site – the real figure is probably much higher, and by the same token, some of those listed may well be past expiry date. And there’s probably a miscount or two in there, or a duplicated framework – so take it all with a grain of salt! In any event, this means around 1.5 new frameworks per week, a little less than the previous period (around 1 every 3 days from December, 2005 to May, 2006). This time round, there’s a more detailed breakdown available as a Google Spreadsheet, counting by language and framework category. There are 79 pure-Javascript frameworks and 131 server-side frameworks, up from 58 and 76 last year.

Pure Javascript

Multipurpose 37
Remoting 19
Graphics and Effects 6
Flash 3
Logging 5
XML 6
Specialised 3
Subtotal 79

Server-Side

4D 1
C++ 1
Coldfusion 4
Eiffel 0
DotNet (+ASP/C*) 19
Java 44
Lisp 1
Lotus Notes 2
Multi-Language 11
Perl 2
PHP 38
Python 5
Ruby 1
Smalltalk 1
Tcl 1
Subtotal 131

TOTAL 210

The Ruby count caught my eye: one, but it’s a biggie :).

What does this mean? That a Java developer has 44 frameworks and libraries to choose from? No, the more accurate answer would be around 130-odd. That’s 44 Java, around 8 multi-language (most of the multi-language frameworks offer Java plus one or more other languages) and 79 Javascript frameworks. If you’re still rolling your own XMLHttpRequests or visual effects, now might be a good time to start investigating the alternatives.

Posted by Michael Mahemoff at 1:01 pm
7 Comments

++++-
4.4 rating from 31 votes

Wednesday, May 9th, 2007

Iris: Example of combining Java applets and Ajax

Category: Java, Showcase

Last week I got to see Iris, a Flickr manager that uses Java applets and Ajax together to give enhanced features such as:

  • Native desktop integration (drag and drop works, full screen)
  • Rich media: OpenGL for 3D graphics (hardware accelerated), OpenAL for spatialized audio, Java Media codecs

Jasper Potts, a Sun developer, explains Iris, and points us to a video of the product.

There are some really nice features here, although having to click through three “trusted” dialogs is a pain. Also, note that you need Java 6 installed to see the glory.

The Swing team had an interesting time delving into the CSS world, and aren’t fans of it for layout. That being said, they would love to be able to style Swing components in a simple way, and our own Ben has a solution to this problem.

Examples

Here we see drag and drop support:

Iris Drag From App

Rich editing of images is available:

Iris Edit

This diagram shows us how the bottom applet fits into a frame and communicates with the Java side.

Iris Pieces

Posted by Dion Almaer at 8:42 am
11 Comments

+++--
3.1 rating from 48 votes

Tuesday, May 8th, 2007

MooTools 1.1 Released

Category: JavaScript, Library, MooTools

MooTools version 1.1 has been released with “with crazy optimizations for speed, compatibility, flexibility, and all around greatness.”

New Features

  • Custom Events: A brand-new API to define custom events. The events ‘mouseenter’, and ‘mouseleave’, and ‘domready’ have been added as custom events.
  • Enhanced Element(): New methods, and enhancements such as an improved way to add HTML, such as:
    javascript

    1. var note = new Element('div', {
    2.         'id': 'note',
    3.         'class': 'note',
    4.         'styles': {
    5.                 'left': 15,
    6.                 'top': 15
    7.         },
    8.         'events': {
    9.                 'click': noteConfirm,
    10.                 'mouseover': noteShowMore
    11.         }
    12. });
  • Element Filters: $(‘myElement’).getChildren().filterByClass(‘myClass’);
  • Perfecting Ajax: Ajax::cancel allows running requests to be aborted, Ajax::evalScripts has been enhanced to include global eval and automated evaluation of responses with a JavaScript Content-Type
  • Hash.Cookie is an extended Hash Class that can automatically and manually save and load Hash values using JSON in a Cookie.
  • Generics have been added for native prototypes, Element, and Elements.
  • Advanced Garbage Collection: $(‘content’).empty().setHTML(newText);

For more information check out:

Posted by Dion Almaer at 6:01 am
22 Comments

++++-
4.1 rating from 72 votes

Monday, April 30th, 2007

Mini Review – Google Web Toolkit Solutions: Cool & Useful Stuff

Category: Book Reviews, GWT

A mini book deserves a mini review, and so it is with the “Digital Shortcut” from January 2007 entitled Googleâ„¢ Web Toolkit Solutions (Digital Short Cut): Cool & Useful Stuff. The 112 page PDF goes further than any of the free tutorials out there in that it develops two non-trivial applications using GWT: a Yahoo! Trips app that uses proxied Yahoo web services, and an Address Book, that makes use of Hibernate persistence through RPC.

The applications are non-trivial in that they tackle complex use cases, backend processing, web service, backend persistence and the integration of third party Javascript frameworks — all aspects of GWT application development that are of great interest to serious developers. (Source code available for download.) In order, the chapters cover the following:

  1. Chapter 1 covers what must already be fairly familiar to most GWT developers — making an RPC call to a backend servlet. This chapter, however, does an exceptionally good job of explaining the why and how of GWT RPC in exhaustive detail. The Yahoo Trips application is used to illustrate how to proxy an RSS feed.
  2. Chapter 2 shows how to integrate third party Javascript libraries with GWT. In this case Scriptaculous is used to provide an effect in the Yahoo Trips application to the panel containing the search results. The chapter focuses on two ways to incorporate scripts in the app — simply including script tags in the application html file, and GWT script injection, i.e. through the GWT config file.
  3. Chapter 3 shows one way of how to implement drag and drop with GWT, using a fairly OO approach. The code seems pretty reusable and useful. Again, the Yahoo! Trips app is used.
  4. Chapter 4 shows how to bring GWT into the mix. Most of it is old hat for experienced Hibernate hands, but the example does work through implementing a sort of remote DAO using the GWT RPC. It’s always good to see how that is done, even if it looks simple on paper. The Address Book app is used for this example.
  5. Chapter 5 shows how to use ant to deploy your apps to Tomcat. I assume most everyone is using Googlipse or some non-free alternative, but writing ant files for automated build environments is still a useful thing to know.
  6. Chapter 6 illustrates the use of popups and “deferred commands.” Popups are obvious (modal and modeless dialogs); deferred commands are a way of giving focus to widgets that have not yet been displayed. I really haven’t seen good treatment of this aspect of GWT programming elsewhere. Uses the Address Book app for this example.

Over all, the book doesn’t skimp on explanations and code samples and is written in a clear style. It doesn’t address unit testing with JUnit, but I suppose you can get that information elsewhere. For those of you who like to learn by doing, this is a decent tutorial (and worth the $10 price tag) that can tide you over until the bigger GWT tomes come out.

Posted by Dietrich Kappe at 10:00 am
1 Comment

++++-
4.1 rating from 42 votes

Friday, April 6th, 2007

Update Firebug to 1.0.4

Category: Tip, Utility

Update — go get 1.04 — its a more robust fix for the security issue – read Joe’s comment here.

Joe Hewitt has posted an update to Firebug that you should grab right away as it fixes a couple of issues and covers a 0-day security hole.

The update has been published to addons.mozilla.org, so you can get it by updating Firebug from the Firefox Add-ons window. Alternatively, you can install the update using the big orange button on the getfirebug.com home page.

Posted by Dion Almaer at 2:00 am
6 Comments

++++-
4.2 rating from 31 votes

Wednesday, March 28th, 2007

wxJavaScript: JS port of wxWidgets and beyond

Category: JavaScript, Library

Franky Braem and his team have created wxJavaScript, a UI toolkit that started out as a port of wxWidgets:

But at this time, wxJavaScript is a lot more. wxJavaScript has an Apache module
mod_wxjs, an SQLite module, … And many
other modules are planned. So with wxJavaScript, you can write
server side scripts for generating (x)html pages, system scripts,
GUI applications, … in one of the most used programming languages: JavaScript.

wxJavaScript uses SpiderMonkey. SpiderMonkey is the
JavaScript engine of Mozilla.
E4X is activated
in wxJavaScript. E4X is a programming language extension that adds native XML support to
JavaScript.

With wxJavaScript you can write system scripts, gui applications or
dynamic webpages using JavaScript. This isn’t another Ajax library.

This release contains the following updates:

  • Introduced namespaces (like used in YUI)
  • + tpl (Template module) uses namespace ‘tpl’
  • + Sqlite uses namespace ‘sqlite’
  • MySQL module introduced
  • wxHtmlWindow added
  • Renamed xml module into expat module
  • sqlite: removed open (use ctor now), close, finalize (automatically done)
  • db: removed close method (automatically done)
  • renamed property isOpened to opened
  • The firstline of the script can contain a shebang now (#!)
  • mod_wxjs: wxJS_PreScript and wxJS_PostScript directives added

Posted by Dion Almaer at 8:26 am
8 Comments

++++-
4.1 rating from 32 votes

Monday, March 19th, 2007

Adobe Apollo Alpha Release

Category: Adobe, Announcements

Apollo Logo

Adobe has now released Apollo into the wild with its alpha release.

This is far from the final version, but does give everyone an early chance to play with the new platform.

You can grab the runtime and the SDK for Mac and Windows to start building.

There are sample applications to get inspiration from, and you can watch the DEMO 2007 talk.

Now is the time to push Adobe in directions that you want them to go. How native do you need Apollo to be (range: “nothing. Flash is just fine” to “let me write to my device drivers damn it”)?

Adobe has the ear of the Flash world, but let’s make sure they hear about our needs… from the Ajax world.

Posted by Dion Almaer at 12:06 am
15 Comments

+++--
3.7 rating from 30 votes

Thursday, March 15th, 2007

Visits, not page views

Category: Advertising, Business

Not for the first time, alternative models to page views are in the news.

This time, comScore has announced a new “visits” metric. “AJAX” is cited as one of the motivations.

comScore Media Metrix today released its monthly analysis of U.S. consumer activity at top online properties and categories for February 2007 and introduced a new suite of metrics based on site visits. The visits metric, defined as the number of times a unique person accesses content within a Web entity with breaks between access of at least 30 minutes, is a way of measuring the frequency with which a person views content, thereby illustrating a key component of user engagement. Included among the new suite of metrics are: total visits, average minutes per visit, average visits per visitor, and average visits per usage day.

As technologies like AJAX change the Internet landscape, certain measures of engagement, such as page views, are diminishing in significance for many Web properties, said Jack Flanagan, executive vice president of comScore Media Metrix. The introduction of these new metrics based on visits provides an alternative for measuring user engagement that tells us how frequently visitors are actually returning to the site to view more content.

Posted by Michael Mahemoff at 6:50 pm
11 Comments

+++--
3.3 rating from 46 votes

Tuesday, March 6th, 2007

Lily: Graphical data-flow programming environment

Category: Showcase, Utility

Bill Orcutt has been working on Lily, a graphical data-flow programming environment that runs in a web browser:

Programs are built graphically by connecting modules to add functionality, fetch and direct
the flow of data, play sound or video, add interactivity or display results. Lily programs can be shared with other Lily users, installed as Firefox add-ons, run as standalone apps using XULrunner, or (with some limitations) be embedded in a web page.

Or, as Bill told us:

It’s sort of a client-side version of Yahoo’s Pipes written in Javascript. I’ve been working on it since July and it’s fairly far along- there’s over 150 modules available wrapping web apis, various UI widgets (both browser native and from the various JS libraries- YUI, Scriptaculous, JQuery, etc), privileged access to Storage, the file system & sockets, SVG graphics & Multimedia. There’s also an SDK available and its very simple and straightforward to develop new modules in JS. Programs developed in Lily can be shared with other users (the programs
themselves are saved as .json files) or exported as FF add-ons, standalone Xulrunner apps or simply as js/html that can be displayed in a web page.

Check out the demo screencasts to get a feel for it. There is some pretty amazing stuff here. I liked Pipes, but wanted to be able to create my own modules. With Lily you can create your own modules in simple JavaScript!

Lily App

Posted by Dion Almaer at 9:34 am
7 Comments

++++-
4 rating from 24 votes

Thursday, March 1st, 2007

Adobe Engage: Apollo as Web+ rather than Desktop-

Category: Adobe

There has been a lot of coverage of the Adobe Engage event.

Ben and I were also there and enjoyed being able to get a glimpse of what Apollo will have to offer.

Today was the day of a dive into the tech itself instead of a bunch of demos (some cool, many not actually using Apollo though!).

One thing is very interesting. As we look at the convergence of the web and the desktop (from both directions) we now see the Apollo 1.0 is very much Web+ rather than Desktop-.

This means that Apollo really is aiming to get web development just a bit further onto desktops via features such as being able to launch apps, offline support, file storage, etc. These features mean that you will have less and less of a reason to go for the full desktop approach.

This also means that there are plenty of applications that will probably require you to go for a full desktop application platform.

Apollo is not released, and there are still discussions on which features will be in there for us. Do you think they should go with the Java-like approach and abstract above the native platform so that you apps work everywhere? Or should we be allowed to get down and dirty and do native interactions if you need too?

Posted by Dion Almaer at 8:00 am
9 Comments

+++--
3.5 rating from 20 votes

Tuesday, February 27th, 2007

Dojo Offline Demo and Release

Category: Dojo, JavaScript, Offline, Screencast

Brad Neuberg keeps sprinting with his offline work for Dojo. He has just released a demo of an offline aware editor, and a release of the code itself:

We’ve finished the JavaScript layer of Dojo Offline. Dojo Offline consists of two major pieces: a JavaScript API that is included with a web application, and which helps with syncing, on/offline status notification, caching of data and resources, etc.; and a local small web proxy download that is cross-platform and cross-browser and which is web application independent. The JavaScript API is now finished, and can actually be used even though we have not finished the local web proxy yet. This is done by having the JavaScript layer be able to use the browser’s native cache if no offline cache is available. This means you can start playing with Dojo Offline right now, with the download link included in this blog post below. Note that using the browser cache instead of the web proxy is only suitable for prototyping and should not be deployed on production applications; it will work with varying degrees of success on Internet Explorer and Firefox, but not consistently on Safari. Higher levels of reliability will only come when we deliver the local web proxy component.

To start using Dojo Offline now in conjunction with the browser cache, you must have the following in your JavaScript code: dojo.off.requireOfflineCache = false. You must also turn on HTTP caching headers on your web server; how to turn on these HTTP headers and which ones to turn on are explained in the Dojo Storage FAQ. See the Moxie code links below for more examples of how to use the API. Note that the Dojo Offline JavaScript API has changed, especially for syncing, since our API blog post about a month ago and has become much simpler — see the Moxie source for details.

The demo of Moxie shown in the screencast can also be played with right in your browser. Please note that both Moxie and Dojo Offline are still alpha; you are literally seeing Dojo Offline being developed in front of your eyes, and glitches remain in both of them. Please debug and provide test cases for errors you find to help development.

Info

Moxie Offline Demo

Posted by Dion Almaer at 12:01 am
2 Comments

++++-
4.2 rating from 24 votes

Tuesday, February 20th, 2007

Jack Slocum of Ext to support jQuery

Category: jQuery, Sencha

Jack Slocum is one of the best evangelists of YUI (in our opinion) as he gets cool stuff out there that uses YUI. Some of his newer features are not YUI-specific so his YUI-EXT project will become Ext, and will support other libraries.

One of the fruits of this new world is the partnership announced jQuery & Ext Partner to Deliver Integrated JavaScript & UI which details how Ext 1.0 will support jQuery as well as YUI:

The most mature User Interface library for web applications will soon support jQuery, the two projects announced today.

Ext, a group of renowned User Interface components including a tree view, live grid, dual-panel layout among others, previously worked as an extension to the YUI library. Beginning with version 1.0 of Ext, it will work as an extension to jQuery as well, allowing jQuery users to leverage the power of the user interface tools available in Ext with the lightweight core library and expressive syntax of the best library for unobtrusive DOM scripting.

“We’re really excited by this collaboration. Ext is a fantastic library, and being able to provide it as an official jQuery Plugin is a huge win for everyone involved,” said John Resig, the creator of the jQuery JavaScript library.

What prompted the collaboration?

Ext has some fantastic components – arguably, the best on the web.

jQuery has all the core functionality to support what Ext provides, with a far smaller core file-size than YUI. The jQuery team contacted Jack Slocum with the hopes that we could work together to make Ext work with jQuery, and Jack wholeheartedly agreed. It’s a win-win situation: jQuery gets some awesome components, and Ext gets a huge influx of new users.

What are the benefits for jQuery and Ext users?

jQuery users get a huge number of expertly-designed components that they will be able to deploy immediately. Additionally, they’ll be able to use them in a manner that better suits the jQuery philosophy (e.g. leveraging jQuery’s unobtrusive philosophy, being able to call Ext queries on sets of elements, chaining calls, etc.) Additionally, jQuery is also investigating the possibility of supporting the use of DomQuery, Ext’s selector engine, as an alternative to jQuery’s CSS Selector code.

At the same time, existing Ext users will gain the flexibility of being able to continue to use Ext’s professional caliber components while leveraging the lightweight, small (~19k) and powerful jQuery framework.

This is good news for all. It also shows how plugged in jQuery is to the community to get this worked out with Jack.

We can’t wait to see the full Ext 1.0 and beyond.

Posted by Dion Almaer at 12:01 am
34 Comments

++++-
4.2 rating from 64 votes

Monday, February 19th, 2007

Threading in JavaScript 1.7

Category: Editorial

Neil Mix wrote a post before Brendan discussing how we can do threading in JavaScript 1.7:

Amongst the many new features contained in Firefox 2 you’ll find JavaScript 1.7 support, a small but significant language enhancement. While there are several interesting features, the python style generators are of particular interest to me.

A generator allows you to suspend a function’s execution and resume it at a later time. While typically used for advanced looping constructs, a generator can also be flipped inside-out and used as a rudimentary coroutine.

At first glance, this may not look very impressive, especially since generators are unable to yield across multiple frames in the callstack. However, with the help of a technique called trampolining generators can be used to create advanced threading as powerful as that found in Narrative JavaScript.

You end up with code like this:

javascript

  1. function myThreadedCall() {
  2.     while (!ready) {
  3.       yield sleep(100);
  4.     }
  5.     yield waitForInput();
  6.     if ((yield post(getInput())) != null ) {
  7.       yield animateUI();
  8.     }
  9.   }

Not the most intuitive to many.

Brendan himself commented:

Hey Neil, I wanted to add that the winning argument against Lua-style coroutines in es4-discuss, IMHO, came from Lars T Hansen, who wrote:

“ECMAScript already has potential script-native-script call stacks in library functions that accept callbacks, like Array.prototype.sort and String.prototype.replace. So [Lua-style coroutines] would be a restriction in all implementations that are not prepared to write their libraries in ECMAScript. So it would be implementation dependent on whether you could yield from a callback to these methods. This does not seem like a feature.”

Posted by Dion Almaer at 12:34 am
4 Comments

+++--
3.7 rating from 30 votes