K
keyofdminor
Folks,
Short version:
Has anyone tried a synchronous call ("SJAX") to a server with the
Prototype library? I'm curious if there is a bug in the library
(possible) or if I am making mistake (probable).
Longer version:
I am updating a tree structure by using an Ajax call with Prototype.
The response handler adds nodes to the DOM (w3c-style -- not
innerHTML). However, other Javascript does not "see" the new nodes.
The logging suggests that the handler is being fired off in the
background asynchronously.
Here's a snippet:
var myAjax = new Ajax.Request( myUrl ,
{
method: 'get',
parameters: '',
options: { asynchronous: false }, // ??
onComplete: function(response) {
var text = response.responseText;
treeData = eval('(' + text + ')');
myPopulate(treeData);
}
});
checkForNodes(); // this should not execute until after the myPopulate
handler completes
I'm a Java guy who does not work with Javascript often. Is there an
inherent problem with this setup?
Any help is greatly appreciated... crunch time here.
thanks,
Mike
(e-mail address removed)
Short version:
Has anyone tried a synchronous call ("SJAX") to a server with the
Prototype library? I'm curious if there is a bug in the library
(possible) or if I am making mistake (probable).
Longer version:
I am updating a tree structure by using an Ajax call with Prototype.
The response handler adds nodes to the DOM (w3c-style -- not
innerHTML). However, other Javascript does not "see" the new nodes.
The logging suggests that the handler is being fired off in the
background asynchronously.
Here's a snippet:
var myAjax = new Ajax.Request( myUrl ,
{
method: 'get',
parameters: '',
options: { asynchronous: false }, // ??
onComplete: function(response) {
var text = response.responseText;
treeData = eval('(' + text + ')');
myPopulate(treeData);
}
});
checkForNodes(); // this should not execute until after the myPopulate
handler completes
I'm a Java guy who does not work with Javascript often. Is there an
inherent problem with this setup?
Any help is greatly appreciated... crunch time here.
thanks,
Mike
(e-mail address removed)