PDA

View Full Version : exception event not works in ie. WHY?



jangy
23 Jul 2009, 4:07 AM
This code works fine in FF, Chrome but not in ie 6,7,8 why?What's wrong?


DataStore = new Ext.data.Store({
id: 'DataStore',
proxy: new Ext.data.HttpProxy({url: '../loadGrid.do',method: 'POST'}),
reader : new Ext.data.XmlReader({record : 'tipocarta'}, RecordDef),
baseParams:{action: actionLoad}
});
DataStore.on({
exception: function(proxy, type, action, options, response, arg) {
//var result = response.responseText;
Ext.MessageBox.alert('Errore');
//Ext.MessageBox.alert('Errore nel caricamento Dati(exception)','result: '+result, 'type: '+type);
},
scope: this
});

Condor
23 Jul 2009, 4:29 AM
This code looks ok, so the problem is probably somewhere else.

Did you run your code through jslint.com?

jangy
23 Jul 2009, 5:26 AM
thanks I made the changes for the mistakes that I have shown in jslint,
but not works in ie 6,7,8 they not catch exception event on DataStore.
Why it works only in FF??

Condor
23 Jul 2009, 6:07 AM
Do you get any javascript errors in IE?

Did you try the debugger that comes with IE8?

jangy
23 Jul 2009, 6:23 AM
no any error in the debugger of ie8.
When the script works with normal xml, exception not works , and it's fine!!!
When the response isn't xml but it is simple responseText FF catch this error and stamp alert (es. Ext.MessageBox.alert('Error',resp.responseText) or only alert('Error')) instead ie don't entry in the exception event. if you prefer post all code...

thanks for your help!! and sorry for my horrible english....

jangy
24 Jul 2009, 2:36 AM
Can you help me Condor?
Thanks....

Condor
24 Jul 2009, 2:41 AM
What exactly is your server returning (header+data)?

jangy
24 Jul 2009, 4:40 AM
header:

HTTP/1.1 200 OK
Date: Fri, 24 Jul 2009 12:47:52 GMT
Content-Language: it
Content-Length: 37
Content-Type: text/html; charset=utf-8

Data:

Error execute the invoke to ExistBUS.

The data is a example of text error

Condor
24 Jul 2009, 4:45 AM
IE will load this data an interpret the HTML as XML and the XMLReader will try to read it and find no data (but this isn't an error).

I suggest you return a different HTTP response code (e.g. 500). That will definitely trigger an exception event.

jangy
24 Jul 2009, 6:10 AM
=D>=D>=D>=D>=D>=D> ok now works....
there is only a problem...:-/
in ie6,7,8 i view Message alert is wrong...
in FF it's ok why??
there are two Attach Files FF and ie6
The code is:

Ext.MessageBox.alert('Errore nel caricamento Dati',response.responseText);

thanks for your availability....:)

Condor
24 Jul 2009, 8:38 AM
There is either something wrong with your javascript (any errors) or the responseText doesn't contain valid HTML.

jangy
27 Jul 2009, 7:48 AM
i have tested my js in jslint and it works fine in FF...
The responseText contain only text...(es. There are errors).
Why it works fine in FF and in ie i see the distorted image?

help me please....