PDA

View Full Version : Ajax on localhost [Windows]



pw81
11 Aug 2009, 12:15 AM
Hi,


I`ve got some strange problem with Ext Ajax.

I`ve created a function for ajax

---------------------------------------------
function getAjax(action,container_id){

Ext.Ajax.request({
url: action,
params: {
test: 1,
},
timeout: 500,
method: 'POST',
success: function(xhr) {
document.getElementById(container_id).innerHTML=xhr.responseText;
}
});
return false;
}
----------------------------------

My problem is that when I called getAjax function on localhost (ONLY ON WINDOWS)
action is launched but the response is not loaded. (I`ve checked this in firebug plugin console)
On unix systems everything is OK (tested on ubuntu and slack)

This problem was tested on Vista ( 2 computers)
- Tested on web servers (Apache 2, IIS)
- Tested on browsers (FF,IE,Opera,Chrome)
- System firewall was disabled,
- Javascript is enabled
- Disabled plugins NoScript & AdBlock for firefox
- Response headers are ok

I dont know what can be wrong.

Of course action exists and server side script works fine so it must be some problem with ext on windows.

Condor
11 Aug 2009, 1:00 AM
Did you trace the request (Firefox/Firebug Net tab or IE/Fiddler)?

pw81
11 Aug 2009, 2:15 AM
yes i did in firebug...

In firebug console appears new ajax action on list but it seems like remote script (ajax) still waiting for execution?!?!

There is a button "Load response" on the response tab but even if I clicked it, not works for me.

The stragest thing is that in another part of code, where I generate layout I have also ajax (autoload + listeners) and IT WORKS FINE.

below example code that works :

var tabPanel = new Ext.TabPanel({
region:'center',
deferredRender:false,
autoScroll: true,
margins:'0 4 4 0',
activeTab:0,
items:[{
id:'tab1',
item_id:'tab1',
contentEl:'tabb1',
title: 'Main site',
autoLoad: {url: action1, nocache: true, callback: this.initSearch, scope: this},
closable:false,
autoScroll:true,
listeners:{
activate : function(tabitem){
tabitem.getUpdater().refresh();
}
}
},{
id:'tab2',
item_id:'tab2',
contentEl:'tabb2',
title: 'Tasks',
closable:false,
autoScroll:true,
autoLoad: {url: action2, nocache: true, scope: this, text: "Loading ..."},
listeners:{
activate : function(tabitem){
tabitem.getUpdater().refresh();
}
}
]
});

Condor
11 Aug 2009, 2:55 AM
OK, but you are doing a POST request to the server with Ext.Ajax and the others are GET requests.

Is your server setup to handle a POST request?

pw81
11 Aug 2009, 3:22 AM
Request method doesnt matter - I was trying GET and POST ... still searching for solve this puzzle