Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


ajax onreadystatechange parameter

Posted on 2009-07-07
Medium Priority
Last Modified: 2012-08-14
I want to pass a parameter to the callback function to identify one ajax call from another.  
This code is not doing the business.  Is it possible?  How is it done?
function runscript(page, data, element)
	//get ajax object
	// set callback
	//check there is a connection to server
	if (HTTPrequest[req_no]==null)
		alert ("Browser does not support HTTP Request");
	info['ajax'] += 1;
	info['script'] = page;
	//create script url
	var url=page+".php";
	for(i in data)
	//load the script

Open in new window

Question by:Koakuma
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
LVL 75

Accepted Solution

Michel Plungjan earned 2000 total points
ID: 24794283
HTTPrequest[req_no].onreadystatechange=new function () { stateChanged(req_no) }


Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question