Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts

Eclipse & jrunscript: Auto completion

To get jrunscript auto completion working inside Eclipse, there are only a few steps needed. First the source code (including JSDoc) of the used JDK has to be extracted. Jrunscript's global functions and objects are located in the init.js file which is part of the tools.jar. For my Win7 / Cygwin setup I used the command line:

Javascript - Getter are evil? - Some performance tests

According to this nice article Javaworld (09-2003)  I decided to check getters and setters runtime behavior with JavaScript inside different browsers and on different machines. I tested also the different initialization possibilities, with some unexpected, but not really surprising, results.

Some interpretation tries... Chrome seems to be very constant in each kind of implementation, also it slightly improve its performance in newer versions. Firefox has the highest variation, but again newer version have better times. IE9 does a good job in this case, constant times and very fast. As expected IE8 has runtime problems even with this simple script.

It would be nice if some people add their results, maybe with some more browser versions, like Safari, IE10, Opera, ...

PhoneGap - Remote error logging (incl. uncaught script errors)

Catching and logging runtime errors, like script errors, in PhoneGap can be a challenge. There are several possibilities to write logs and to handle errors with different advantages and disadvantages.

First, local error logging means to create a functionality to send data to a place where someone cares about. Also this will spam the device with a text file or database, occupies memory and the question "when to send where?" has to be solved.

Phonegap - Real persistent storage module (incl jQuery deferred example)

There are several possibilities to store persistent data for a mobile app in Phonegap. But because you cannot be not sure that native HTML capabilities, e.g. localStorage is really stored permanently (see discussion on GoogleGroups), I decided to share my little RequireJS module prototype. It uses JSON and the mobile filesystem which enables also the possibility to use the data even after the app was completely deleted and reinstalled.