473,396 Members | 2,109 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,396 software developers and data experts.

Epxlorer and AJAX

I'm Trying to write a chat width AJAX.
For so far it works fine in Firefox browser, The only problem I had is
width the Explorer.
The function setTimeOut doesn't seem to work well width AJAX. The
Explorer turn to the DB only ones.

did anyone ever bump into it?
Appendix

This is the function I used

var the_count = 0;
function users()
{
the_timeout = setTimeout('users();', 500);
sndReqOutput('' ,'users')

the_count += 1;

}
users();
This is the AJAX part (I didnt write it by myself):

function createRequestObject() {

var ro;

if (window.XMLHttpRequest){

try {

ro = new XMLHttpRequest();

} catch(e) {

//some kind of a weird mistake...you choose what you want to
do

ro = false;

}

} else if(window.ActiveXObject){

try{

ro = new ActiveXObject("Msxml2.HTMLHTTP");

} catch(e) {

try{

ro=new ActiveXObject("Microsoft.XMLHTTP");

} catch(e) {

//don't know what to do...you choose

ro = false;

}

}

}

return ro;

}


var http = createRequestObject();

function sndReqOutput(action, page) {

http.open('get', page+'.php?action='+action,true);

http.onreadystatechange = output
http.send(null);

}

function output() {

if(http.readyState == 4){

var response = http.responseText;
document.getElementById('users').innerHTML=respons e


}

}

Thanking you in anticipation

May 11 '07 #1
3 1440
On 11 May, 14:07, work.Yeh...@gmail.com wrote:
I'm Trying to write a chat width AJAX.
For so far it works fine in Firefox browser, The only problem I had is
width the Explorer.
The function setTimeOut doesn't seem to work well width AJAX. The
Explorer turn to the DB only ones.

did anyone ever bump into it?

Appendix

This is the function I used

var the_count = 0;
function users()
{
the_timeout = setTimeout('users();', 500);
sndReqOutput('' ,'users')

the_count += 1;

}
users();

This is the AJAX part (I didnt write it by myself):

function createRequestObject() {

var ro;

if (window.XMLHttpRequest){

try {

ro = new XMLHttpRequest();

} catch(e) {

//some kind of a weird mistake...you choose what you want to
do

ro = false;

}

} else if(window.ActiveXObject){

try{

ro = new ActiveXObject("Msxml2.HTMLHTTP");

} catch(e) {

try{

ro=new ActiveXObject("Microsoft.XMLHTTP");

} catch(e) {

//don't know what to do...you choose

ro = false;

}

}

}

return ro;

}

var http = createRequestObject();

function sndReqOutput(action, page) {

http.open('get', page+'.php?action='+action,true);

http.onreadystatechange = output
http.send(null);

}

function output() {

if(http.readyState == 4){

var response = http.responseText;
document.getElementById('users').innerHTML=respons e

}

}

Thanking you in anticipation
your interval is very small, have you considered server load, having
long open connections with a "push" to the client is much more
efficient, unlike short open connections repeated often.
If you want a true chat application consider using jetty server.

May 11 '07 #2
On May 11, 3:15 pm, shimmyshack <matt.fa...@gmail.comwrote:
On 11 May, 14:07, work.Yeh...@gmail.com wrote:


I'm Trying to write a chat width AJAX.
For so far it works fine in Firefox browser, The only problem I had is
width the Explorer.
The function setTimeOut doesn't seem to work well width AJAX. The
Explorer turn to the DB only ones.
did anyone ever bump into it?
Appendix
This is the function I used
var the_count = 0;
function users()
{
the_timeout = setTimeout('users();', 500);
sndReqOutput('' ,'users')
the_count += 1;
}
users();
This is the AJAX part (I didnt write it by myself):
function createRequestObject() {
var ro;
if (window.XMLHttpRequest){
try {
ro = new XMLHttpRequest();
} catch(e) {
//some kind of a weird mistake...you choose what you want to
do
ro = false;
}
} else if(window.ActiveXObject){
try{
ro = new ActiveXObject("Msxml2.HTMLHTTP");
} catch(e) {
try{
ro=new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
//don't know what to do...you choose
ro = false;
}
}
}
return ro;
}
var http = createRequestObject();
function sndReqOutput(action, page) {
http.open('get', page+'.php?action='+action,true);
http.onreadystatechange = output
http.send(null);
}
function output() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('users').innerHTML=respons e
}
}
Thanking you in anticipation

your interval is very small, have you considered server load, having
long open connections with a "push" to the client is much more
efficient, unlike short open connections repeated often.
If you want a true chat application consider using jetty server.- Hide quoted text -

- Show quoted text -
I don't understand. :(
What do you mean by 'server load'?
What is 'Jetty Server'?
Do you mean using different language then JS and PHP?
I'm sorry. maybe it's because of my English (I'm an Israelian), Or
becuase I'm not familiar enough with javascript(I'm quite new ).
Please exlain to me

thank you

May 11 '07 #3
On May 11, 3:23 pm, work.Yeh...@gmail.com wrote:
On May 11, 3:15 pm, shimmyshack <matt.fa...@gmail.comwrote:


On 11 May, 14:07, work.Yeh...@gmail.com wrote:
I'm Trying to write a chat width AJAX.
For so far it works fine in Firefox browser, The only problem I had is
width the Explorer.
The function setTimeOut doesn't seem to work well width AJAX. The
Explorer turn to the DB only ones.
did anyone ever bump into it?
Appendix
This is the function I used
var the_count = 0;
function users()
{
the_timeout = setTimeout('users();', 500);
sndReqOutput('' ,'users')
the_count += 1;
}
users();
This is the AJAX part (I didnt write it by myself):
function createRequestObject() {
var ro;
if (window.XMLHttpRequest){
try {
ro = new XMLHttpRequest();
} catch(e) {
//some kind of a weird mistake...you choose what you want to
do
ro = false;
}
} else if(window.ActiveXObject){
try{
ro = new ActiveXObject("Msxml2.HTMLHTTP");
} catch(e) {
try{
ro=new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
//don't know what to do...you choose
ro = false;
}
}
}
return ro;
}
var http = createRequestObject();
function sndReqOutput(action, page) {
http.open('get', page+'.php?action='+action,true);
http.onreadystatechange = output
http.send(null);
}
function output() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('users').innerHTML=respons e
}
}
Thanking you in anticipation
your interval is very small, have you considered server load, having
long open connections with a "push" to the client is much more
efficient, unlike short open connections repeated often.
If you want a true chat application consider using jetty server.- Hide quoted text -
- Show quoted text -

I don't understand. :(
What do you mean by 'server load'?
What is 'Jetty Server'?
Do you mean using different language then JS and PHP?
I'm sorry. maybe it's because of my English (I'm an Israelian), Or
becuase I'm not familiar enough with javascript(I'm quite new ).
Please exlain to me

thank you- Hide quoted text -

- Show quoted text -
jetty server, please see:
http://sourceforge.net/project/showf...?group_id=7322
there is an ajax chat application, try it and you will see the
difference. (when one of you clicks enter, the other sees the data
immediately)

server load - a request every 500ms? are you sure that your server can
respond that quickly before being asked again, then think there will
be two of you to chat, that's 4 requests a second. You are pushing at
the limit of what's possibly unless you are local, the data itself
will take time to travel from server<->browser making the time
interval too small in my opinion.

May 11 '07 #4

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

Similar topics

11
by: Yarco | last post by:
I want to use "Ajax" to create my web for hobby. But i don't know whether "Ajax" is mature... And what about with php? Someone have experience on it? ....
4
by: bobzimuta | last post by:
I'm creating a simple AJAX library. It's an object that will return an array containing the response text or xml. I'm trying to find a way to assign the response as a property of the object, but...
0
by: melledge | last post by:
Ajax Developers' Day added to XTech 2006 agenda XTech 2006 - 17-19 May - Hotel Grand Krasnopolsky - Amsterdam, The Netherlands
1
by: www.web20developers.com | last post by:
http://www.web20developers.com http://www.web20developers.com/index.php?option=com_content&task=view... Ajallerix : AJAX, simple, fast Web image gallery demo ; at Novell AJAX -...
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?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.