Trying to use AjaxRequest Toolbox class

K

KnighT

myAjax = new AjaxRequest();

//I am trying to use this as an object, but it gives errors when I try
to call myAjax.get() telling me that it is not a public function

so I try direct method acces:

AjaxRequest.url = newLocation;
AjaxRequest.get(
{
'onSuccess':function(req){ document.getElementById("content") =
newLocation; }
}
);

All I want is to load a <div id=content> asynchronously, with the value
of newLocation (which is a web address)

I do not understand how to use this object 'arg' parameter for this
method.
I do not know what the req is as a function parameter
 
K

KnighT

I got it to work.

AjaxRequest.url = newLocation;
AjaxRequest.get(
{
'onSuccess':function(req){
document.getElementById("content").innerHTML = req.responseText; }
}
);

I had to reset req.url in the ajaxRequest.js class a few times because
it kept pulling the url from the address bar, or querystring.
 
M

Matt Kruse

KnighT said:
AjaxRequest.url = newLocation;
AjaxRequest.get(
{
'onSuccess':function(req){
document.getElementById("content").innerHTML = req.responseText; }
}
);

Instead, pass url as a paramter:

AjaxRequest.get({
'url':newLocation,
'onSuccess':function(req){ ... }
});
 
K

KnighT

Oh, ok......now I see how to use the parameters. You did a very nice
job on the AjaxRequest class. Thank you Mr.Kruse
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top