[Prototype-core] new Ajax.Request problems with firefox, works fine in IE. Help!

2007-08-05 Thread Adriano

Hey Everyone, I'm trying to use prototype but I cannot seem to use the
Ajax.Request in Firefox 2.0.0.6.  I've stripped it down to bare
essentials and it runs fine in IE.  However, If I try to use it in
FireFox, onException fires.
Thanks for taking a look, any reply would be greatly appreciated!
Adrian


my test.html:
html xmlns=http://www.w3.org/1999/xhtml;
head
titlemy test/title
!-- TinyMCE --
script language=javascript type=text/javascript
src=javascripts/prototype.js/script
script language=javascript type=text/javascript
src=javascripts/test.js/script
/head
body
input type=button name=save value=send
onclick=sendAjaxRequest(); /
/body
/html

my javascripts/test.js:
function sendAjaxRequest() {
var content = content;
var elementId = 123;
var url = http://localhost:8080/AjaxRequest/servlet/
test.AjaxRequestServlet;
var content = content;
var elementId = 1234;
var myAjax = new Ajax.Request(url, {method:post, parameters:
{elementId:elementId, content:content}, onComplete:showResponse,
onException:error});
function error() {
alert(Something went wrong...);
}
function showResponse(originalRequest) {
var reply = originalRequest.responseText;
alert(reply);
}
}


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Ajax.Request can't work async in IE and Maxthon?

2007-08-05 Thread Paladin

Dear users,

Have any one tried Ajax.Request on IE? even i set the async as true
the browser freezes until the request is completed. One interesting
test  u can try is
say we have 5 divs. id 1,2,3,4,5
for(var i=0; i5; i++){

new Ajax.request(url, options(asynchronous:true,
onComplete:function(trans)
{
 $('i').innterHTML = trans.responseText;
}))

}

assume each time we retrieve different data from server. Run in
Firefox and IE, i have observed different results.
In FF all the 5 divs will have the same innerTEXT, which is the last
request, as when data flows back from the server i is already changed
to the last index. But in IE, 5 divs have the different content as
it's processed sync.
Someone pls help me how to set it work properly async in ie?

Thanks!

Jack


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---