javascript - jquery ajax request success portion not working -


i having ajax request success portion not working have been working past 1 hour not able there thing missing.

$.ajax({     url: "ajaxsearch",     type: 'post',     datatype: "jsonp",     headers: {         'accept': 'application/json',         'content-type': 'application/json'     },     data: json.stringify(eval({         name_startswith: request.term     })),      success: function (data) {         alert("yoo"); //what ever write  not executed thing wrong     } }); 

i suggest first try make jquery ajax working simple code modification. can try below code snippet:

<!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title>insert title here</title> <script type="text/javascript" src="jquery-1.8.3.min.js"></script> <script type="text/javascript">     $(function() {         $("#btnsend").click(function(){             var args = {                     url : "http://localhost:8080/jqueryajaxprj/customerservlet",                     type : "post",                     success : handleresponse,                     datatype : "json",                     data : {my-status: "test", my-name: "xyz"}             };             $.ajax(args);         });     });      function handleresponse(response) {         alert(response);     } </script> </head> <body>     <button id="btnsend">send request</button>     <br> </body> 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -