PDA

View Full Version : problem with loading data from a file



ahsec
24 Apr 2012, 12:19 AM
I tried using "request()" method...the following way
Ext.onReady(function(){
var i =0;
Ext.Ajax.request({
url: '/newGui/getPoints.cgi',
params: {
id: 1
},
success: function(response){
var text = response.responseText;
alert(text);

// process server response here
},
callback: function(option,reponse,success){
alert("callback");
},
failure: function(response, opts) {
alert('server-side failure with status code ' + response.status);
}
});
}
);


however, when it reaches the bold part of the success\callback function, it would return the whole code of the python file getPoints instead of running it as a python code and return only the output of the file, as it'd have happened had I used a simple GET\POST using simple javascript...

my question is , how do I make the file run so it'd return me only the program's output..

Thank you all :-)

vietits
24 Apr 2012, 12:31 AM
You should config your webserver to handle /newGui/getPoints.cgi as executable script instead of normal text file.

ahsec
24 Apr 2012, 12:42 AM
well the same file would return the output when I used a regular GET\POST...
I changed the extension to "py" so it would run it as a python file and it still returned the code

:-(

any idea???

I'm transforming an old hand-written gui to extjs's one ..so i dont know why that problem has appeared..