MikeTeo.net

A Software Developer’s Blog (Wanna Email Me?)

If you are using using Dojo and Meteor Javascript library, you could be facing random Javascript errors when your web application runs in Internet Explorer. Your web application is likely to work well on the first page, but may fail when it moves to the second page or refreshes. Errors that surface can include Javascript error warnings from the Internet Explorer, or no connection to the Meteor HTTP service by the Meteor Javascript library. And weirdly, your web application seems to work fine in FireFox.

The Javascript errors seems to be an Internet Explorer specific issue. Fortunately, it can be resolved with a small modification to the Meteor Javascript library.

The errors that you face in Internet Explorer are due to some conflicts in the Meteor Javascript library and Dojo. Meteor needs to perform some housekeeping exercises when the page unloads. However, due to Dojo, the calls to these exercises are overwritten and are not performed. Hence, these errors arise when you move to another page or refresh the same page.

The changes to be made are limited to the meteor.js file under the public_html folder in the Meteor distribution. All you need to do is use dojo.addOnUnload() to make a call to Meteor.disconnect(). This will invoke the respective housekeeping tasks required by Meteor Javascript to make a clean exit in Internet Explorer.

Short Description about Meteor

Meteor is an opensource Perl HTTP service designed to support asynchronously data streaming to web browsers. Conventional methods for receiving asynchronous updates will involve polling at regular intervals. In Meteor, the Meteor Javascript client will establish a persistent HTTP connection to the Meteor HTTP service to receive updates from the service. When the HTTP connection is dropped due to timeout, the Meteor Javascript client will re-establish the HTTP connection again. Data are streamed in the form of messages through subscribed channels, and the Meteor HTTP service can be configured to set expiry times to purge expired messages and reclaim unused channels. Publishers announce their messages by communicating to the Meteor HTTP service using Meteor’s own text-based protocol on a different TCP port.

Add A Comment