javascript - How to run PHP script in the back by a jquery button -


i need run php code file when click button jquery. code have:

$(document).ready(function(){        $("#btnsubmit").button().click(function(){         alert("button 1");          $.ajax({         url: 'releasebackend.php',         type: 'post',         async: false,         data: {},         datatype: 'xml',         error: function(){             alert('error');         },         success: function(data){                     //check error             alert("success!");          }     });      });  }); 

it shows alert of "error". have releasebackend.php file in same directory of javascript file.

change

$("#btnsubmit").button().click( 

to

$("#btnsubmit").click( 

and check whether php page sending response or not.

try getting error in error callback function using xmlhttprequest.

error(xmlhttprequest, textstatus) {  } 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -