473,387 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

What do you really need to know about AJAX

1. First of all, XMLHttpRequest have idiotic API. onreadystatechange
handler have no parameters! (Thanks to Microsoft) So if you have more
then one request on same page for different resources you need to have
separate handler for every request because event handler have no way to
determine which exactly object calls it.
2. It's impossible to have separate handler for every request if you
have variable amount of resources to request (for example tree with
dynamically requested branches). Thanks God javascript was developed by
wise programmers so in normal browsers this problem is solved using
javascript closures.
3. But in IE this is impossible due memory leak. IE garbage collector
can't remove circular references, and this problem is not solved even in
IE7. (Thanks Microsoft again)
4. So we have to make separate component called like 'AjaxChannel'
implementing queue of requests and other components must transfer data
throw it's API.
5. IE don't support readyState==3 so you can't use technique of endless
connection for server-generated events. You need to close down
connection after every server event and reopen it again after processing
data because in IE data will be available ONLY on readyState==4. One
more thank to Microsoft.
6. IE don't support national encodings in XMLHttpRequest so if you have
non-english site you have to use UTF-8 only. If site MUST BE in any
national encoding (like cp-1251 as in my case) you have to implement
recoding routines in javascript and PHP to convert your_site_encoding
<-UTF-8. BIG thanks to Microsoft.
7. After all I recommend to make additional shutdown like this
(specially for IE again):

<script type="text/javascript" for="window" event="onunload">
// Hack for IE
try{downAjax.abort();}catch(e){}
downAjax=0;
</script>

downAjax is the XMLHttpRequest object. Do it for every XMLHttpRequest
object used.

Have nice ajax! :)
Feb 6 '08 #1
0 942

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: G Matthew J | last post by:
interesting "signal vs. noise" blog entry: http://37signals.com/svn/archives2/whats_wrong_with_ajax.php
6
by: RC | last post by:
Is AJAX built on top of JavaScript? What browsers supported AJAX? Can someone tell me some link introduce about AJAX?
4
by: EM_J | last post by:
I am implementing this interface in one of my pages. The RaiseCallbackEvent method runs a task for about 3 seconds. I've noticed when I am on that page and click a tab to navigate to another...
31
by: Mason | last post by:
I've been working to become competent at making websites. My learning path has been: html -css- paintshop pro -javascript -php/mysql I'm getting somewhat proficient at php/mysql (although I...
5
by: PythonistL | last post by:
Can you please recommend a good books about Ajax ? Thank you L
6
by: BJ | last post by:
I just started this week on a new project. The existing project uses BEA Tuxedo as a second layer service broker. The clients make calls to the Tux services which in turn retrieves data from an...
10
by: chadsspameateremail | last post by:
I first should list my background and that is that I'm new to PHP. I would like to be able to have an HTML form where there is a list that you choose from. Depending on what item is chosen in the...
2
by: pincopallo_it | last post by:
I started using dojo for my AJAX application . i need really a selectbox which read a json file and that with the onchange() modify a second select box. I tried using the filtering select of dojo...
3
by: Aleksander | last post by:
Which XML parser would be best for building an on-line RSS/Atom reader? I know for starters there's PHP's DOMDocument and SimpleXML, then there's XMLReader and PEAR's XML_Feed_Parser, and then...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.