samedi 18 avril 2015

file being called by ajax contains error

I have 2 pages, process page and form page


so basically the form page consists of a lot of input text and once the user click the submit button, it runs the ajax call and call the process page. the process page requires user's credentials like id and password.


my ajax call basically success run, but the process page is not running. When there is no user logged in, the process page will output the undefined index message. In this case is the id or password, because basically there is no data passed(ID and Password) to the process page.


this is my ajax call function



function postTweet(){
$.ajax({
url : 'blablabla',
type : 'POST',
data : blablabla,
success: function() {
div1.append("Success!");
}})
.fail(function(data){
console.log(data);
});
}


so basically after the non-loggedin user click the submit button, the Success message will still be displayed out, eventhough basically there is no process running in the process page.


What I want is, if the process basically is not running, I should prompt out a proper message. Can someone help me please?


Any help given is highly appreciated. Thanks


Aucun commentaire:

Enregistrer un commentaire