PDA

View Full Version : Ext.Ajast.Request error



Sundayextjs
21 Aug 2014, 1:31 AM
Hello everybody. i am a new user of Sencha ExtJS and actually i build a MVC website with it. I create a login form and when i send informations from my login form i get this error from Firebug :

NS_ERROR_DOM_BAD_URI: Access to restricted URI denied

[TABLE]

chramer
21 Aug 2014, 1:45 AM
Please provide a code sample

Sundayextjs
21 Aug 2014, 1:52 AM
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
Ext.define(
'SecureDT.controller.Login',
{
extend: 'Ext.app.Controller',

requires: [
'SecureDT.util.MD5'
],

view: [
'Login'
],

init: function(application) {
this.control({

"login form button#submit": {
click: this.onButtonClickSubmit
},

"login form button#cancel": {
click: this.onButtonClickCancel
}
});
},

onButtonClickSubmit: function(button, e, options) {
var formPanel = button.up('form'),
login = button.up('login'),
uts = formPanel.down('textfield[name=utilisateur]').getValue(),
mpt = formPanel.down('textfield[name=motpass]').getValue();

if (formPanel.getForm().isValid()) {
mpt = SecureDT.util.MD5.encode(mpt);



Ext.Ajax.request({
url: 'php/login.php',
params: {
utilisateur: uts,
motpasse: mpt
}
});
}
},

onButtonClickCancel: function(button, e, options) {
button.up('form').getForm().reset();
}
}
);

chramer
21 Aug 2014, 3:45 AM
This is not ExtJS related. This is a security exception in AJAX. It appears because you are trying to do a cross domain request.From the screenshot you provided I can see that you've opened the application index file directly. This isn't right.You need to install a web development environment on your computer, something like wampserver or easyphp.

Sundayextjs
21 Aug 2014, 3:54 AM
Ah ok. thank. i do it with xampp server.