javascript - AJAX call not working in jQGrid -


i trying ajax call inside

       beforeselectrow 

event of grid :

      beforeselectrow: function(rowid, e) {              $.ajax({                 url: "gridedit.jsp",                 datatype: "json",                 async: true,                 cache: false,                 type:"get",                 data: {                     before:'row',                       },                 success: function(data, status)                 {                     alert(data);                 }             });             return true;          } 

here gridedit.jsp :

           <% string b=request.getparameter("before");  if(b.equalsignorecase("row"))    {       system.out.println("row row row boat");       out.println("bummer");    } %> 

i dont error messages. want access data sent gridedit.jsp thats why trying pop alert see whether data being passed or not. when check apache tomcat logs, "row row row boat" string gets printed. not see alert when select row.

please help

thanks

edit:

here tried

    $.ajax({                 url: "gridedit.jsp",                  async: true,                 cache: false,                 type:"get",                 data: {                     before:'row',                       },                       error: function(msg) { alert(msg); },                       complete: function (xhr, status) { alert('complete: '+status); }              }); 

i 2 alerts, first 1 says

    [object][object] 

and second 1 says

    error 

can figure out whats going on ?

please help

thanks

errors;

so here tried

      $.ajax({                 url: "gridedit.jsp",                 //datatype: "json",                 async: true,                 cache: false,                 type:"get",                 data: {                     before:'row'                       },                       error: function( jqxhr, textstatus, errorthrown ) { alert(jqxhr);                       alert(textstatus);                       alert(errorthrown);},                       complete: function (xhr, status) {                            alert('jqxhr:'+xhr);                           alert('complete: '+status); }              }); 

i following alerts in order:

jqxhr: [object][object]

teststatus:

      parseerror 

errorthrown:

      unexpected end of input 

can please me in solving ? gridedit.jsp this->

          <%string b=request.getparameter("before");           system.out.println("b here !" + b);                         out.println("hello");%> 

please help

thanks

your json may not formatted properly. try returning quoted string, such "\"row row row boat\"".


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -