bonjour tout le monde,
voici j'ai essayé de faire une fonction en ajax qui renvoie un bool 0 ou 1
mais elle renvoie rien
voici comment jai fait appel :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 (function($) { emailExist = function(jsemail) { var jsEmailExist; jQuery.ajax({ type: "POST", dataType: "bool", data: { email: jsemail }, url: 'emailExist.php', success: function(data, textStatus, xhr) { alert();//jsEmailExist = xhr.responseText; }, }); return jsEmailExist; }; })(jQuery)
contenu du fichier emailExist.php
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 $(document).ready(function() { ...... $('#frm_signUp #signup-email').blur(function() { if (validateEmail(jsemail)) { ..........
Partager