By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,605 Members | 2,128 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,605 IT Pros & Developers. It's quick & easy.

Trying to use AjaxRequest Toolbox class

P: n/a
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=contentasynchronously, 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

Sep 14 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
VK

KnighT wrote:
All I want is to load a <div id=contentasynchronously, with the value
of newLocation (which is a web address)
Why not use the documentation?
<http://www.ajaxtoolbox.com/request/documentation.php>

In the particular AjaxRequest.async = true will do the job for you.

Sep 14 '06 #2

P: n/a
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.

Sep 14 '06 #3

P: n/a
KnighT wrote:
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){ ... }
});

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Sep 14 '06 #4

P: n/a
Oh, ok......now I see how to use the parameters. You did a very nice
job on the AjaxRequest class. Thank you Mr.Kruse
Matt Kruse wrote:
KnighT wrote:
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){ ... }
});

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Sep 14 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.