473,698 Members | 2,379 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ajax & oo javascript / onreadystatecha nge problem

hi
i'm struggling with integration of a js class aimed for ajax handling
with fireing actions from the class. here's my code sample:

function AjaxLibLoad(htt pActionParam, targetLayerPara m){
this.targetLaye r = targetLayerPara m;
this.httpAction = httpActionParam ;
this.httpReques t = this.httpReques tInstance();
this.load();
};

AjaxLibLoad.pro totype.load = function() {
this.httpReques t.open('get', this.httpAction );
this.httpReques t.onreadystatec hange = this.action; <--here's a
problem
this.httpReques t.send(null);
};

AjaxLibLoad.pro totype.action = function() {
alert('test' + this.httpReques t);
if (this.httpReque st.readyState == 4) {
if (this.httpReque st.status == 200) {

this.userAction ();
} else {
alert('error');
}
} else {
return false;
}
}

AjaxLibLoad.pro totype.userActi on = function() {
document.getEle mentById(this.t argetLayer).inn erHTML =
this.httpReques t.responseText;
autoInit_trees( );
};

sooo what happens
ajax starts well, but alert('test' + this.httpReques t); gives me 'test
[HttpXML...]' only for the first time (action is fired 4 times)

so what for is oo ajax ?? i'm trying to write application that lunch
many ajax instances at the same time, so each one have to run on it's
own httpRequest object to avoid freezing (tha happend when i used one
global instance of httpRequest)

it's interesting issue. it would be great to solve it
thank for Your help

Apr 14 '06 #1
1 1849
VK

va*****@gmail.c om wrote:
i'm trying to write application that lunch
many ajax instances at the same time, so each one have to run on it's
own httpRequest object to avoid freezing (tha happend when i used one
global instance of httpRequest)


<http://www.ajaxtoolbox .com>

Apr 15 '06 #2

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

Similar topics

3
1621
by: Ivan P | last post by:
Hello! I have a index.php that on one click calls via AJAX a file.php. index.php looks like this: <html > <head> <script language="javascript" type="text/javascript" >
17
11873
by: Arjen | last post by:
Hi, I want to reload 2 divs at one click. Ive tried: <a href = "javascript:void(0);" onclick="show('ajaxrequest.php?action=removefield','div1');show('ajaxrequest.php?action=reloaddiv2','div2')">verwijderen</a> While both seperate actions work they dont when I put them together. Anyone know how to fix this ? My ajax.js with funcition show
4
2541
by: UKuser | last post by:
Hi, I'm working on the following code, which works fine in Firefox, but not in IE. The problem is its not posting the variable to my page and I'm thinking its something wrong with the getElementByID but the code is as per an example on a tutorial website (http://www.tizag.com/ ajaxTutorial/ajax-javascript.php). The Select element is as follows: <select style="width:240px;font-size:8pt" id='servicet'
2
4265
by: Nathan Sokalski | last post by:
I am moving my website from my machine to my webhost, and need some help with what extra files I need to include due to the fact that I used AJAX in my site. Everything on the site is obviously functioning as desired when I test it on my machine using Visual Studio 2005. From what I have determined, the files I am forgetting are the JavaScript files from the Microsoft AJAX Library (See "To install Microsoft AJAX Library" at the bottom of...
0
7186
by: Tarik Monem | last post by:
I have been working on an all AJAX/DOM web site which is set to go live today and I thought I'd share my discoveries with all of you whom have helped me when I have encountered different issues along the way. First, deep linking is not something that a completely AJAX web site should be able to do by it's very nature of everything being on one page basically. So how can a person deep link to something that is on one page? This question...
2
3164
by: shivendravikramsingh | last post by:
hi friends, i m using a ajax function for retrieving some values from a database table,and display the values in required field,my prob is that the ajax function i m using is working f9 once,but if i change something in php file using in ajax function.it not refreshed,means its shows the previous result it not get updated.i can't understand whats the prob.this is the code i m using: <? include("config.inc.php"); //error_reporting(0); ...
4
1975
by: slebetman | last post by:
On Jun 5, 9:36 pm, sheldonlg <sheldonlgwrote: You can of course use closure to pass the required parameter: var hideIt; // the variable you wish to pass ajax.onreadystatechange = function () { if (ajax.readyState == 4) { if (hideIt) {// here you can use the variable..} } }
22
1686
by: sheldonlg | last post by:
I am looking for a clean solution to a problem that I solved in, what I call, a "dirty" way. Here is what I want to do. I have a dropdown list. Clicking on an item in the dropdown list invokes an AJAX call that gets data which populates the entire lower part of my screen. It does this with an innerHTML for the div tag that holds all of this. This works fine. I also have an "Edit" button that I want to show next to dropdown list,...
1
4436
by: fidgen | last post by:
Hiya, I'm trying to get a AJAX driven update to my list of news articles, so when users click the title of the news article, it pops up the article content in a thickbox overlay. Retrieving content from the database via AJAX is no problem, that works and thickbox works too, I'm just having problems getting them both running together! It seems like it's too much information to cram into one poor little "a href=".... the "onclick"...
0
8675
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8604
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9160
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8862
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7729
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6521
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2331
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.