php - $.ajax post not working properly -


i trying ajax request using jquery using following code:

$.ajax({     type: 'post',     url: './ajax/mostra_duv.php',     data: 'pag=1&teste=deu',     cache: false,     contenttype: false,     processdata: false }) .done(function(data) {     if(data!='')     {         $("#resumoduvida").html(data);     }     else     {         $("#resumoduvida").html('<p>desculpe, houve um problema na conexão ao servidor. tente novamente</p>');     } }) .fail(function() {     $("#resumoduvida").html('<p>desculpe, houve um problema na conexão ao servidor. tente novamente</p>'); }); 

then, mostra_duv.php calling print_r($_post); resulting in empty array...

i expect $_post['pag'] , $_post['teste'] values corresponding request (respectively 1 , 'deu').

any appreciated! thanks!

just simple code deal point.

$.ajax({     type: 'post',     url: 'pagetoyourscript.php',     data: {page: 1, test: 'test'},     success: function(data){         console.log(data);     },     error: function(jqxhr){         console.log(jqxhr);     } }); 

change values, , handle returned data or error if there is.


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -