QoS of JavaScript

You must be aware of QoS when you are writing Rich Internet Application (RIA), especially when you are using AJAX. Why? And what aspects should be considered in QoS of RIA?

Here are some points:

1. Loading JavaScript file *.js by <script> tag may fail without acknowledge by the following JavaScript, which may result in a total page error;
2. Loading CSS style file *.css by <link> tag may fail, which results in ugly page layout;
3. Loading images by <img> tag may fail, which may confuse users;
4. …

The above scenarios do not occurs often in development period. Because you may using local HTTP server to serve resources, or you may have high bandwidth with slow latency. But if you deploy your applications to server, your server may be busy all the time to serve resources, and will fail to serve some resources at some uncertain time. And people may report such bugs if they are in beta tests, but people may lose their deals or money if such failures happen in real online.

So, QoS is required.

How to make sure the RIA’s qualities? First, make sure that such HTTP timeouts or failures does not interrupt normal business logics. To do so, try reload resources if such failures are detected. It would be easy to reload *.js file by <script> tag, or other resources by other tags. In order to detect failures, you may have your own loader. This is the reason why there is ClassLoader in Java2Script. To detect failures is also easy. Just hook the onerror or onreadystatechange event of loading JavaScript. Or you can setup a thread looping to check whether a *.css or an image is loaded or not.

There are other QoS aspects. Stay tuned for more coming discussions.

This entry was posted in Architecture, Hacks, JavaScript. Bookmark the permalink.

6 Responses to QoS of JavaScript

  1. VINCE says:

    NowReading Aggregating tweets: Search API vs. Streaming API http://t.co/hL2etiRh

  2. Wow, amazing blog layout! How long have you been blogging for? you make blogging look easy. The overall look of your site is fantastic, as well as the content!. Thanks For Your article about QoS of JavaScript | Inside Java2Script .

  3. Shayna says:

    I see you share interesting stuff here, you can earn some extra money, your website has huge potential, for the monetizing method, just
    type in google – K2 advices how to monetize a website

  4. Antonia says:

    I read a lot of interesting articles here. Probably you spend
    a lot of time writing, i know how to save you a lot of time, there is an online tool that creates unique, SEO friendly articles in seconds, just search in google – laranitas
    free content source

  5. Neva says:

    I read a lot of interesting content here. Probably you spend a lot of
    time writing, i know how to save you a lot of work, there is an online tool that creates
    readable, SEO friendly articles in minutes, just search in google
    – laranitas free content source

  6. free code says:

    my friend is getting free itunes gift card code from a online generator

Leave a Reply

Your email address will not be published. Required fields are marked *