0

i used jsonp and call my webapi method successfully but i have problem when i want return values from target server

 $.ajax({
                url: 'http://hub.charsooq.co/api/Order/putorder', // 
                type : "GET", // type of action POST || GET
                dataType : 'jsonp', // data type
                data : $(this).serializeArray(), // post data || get data
                crossDomain: true,
                contentType: "application/json; charset=utf-8",
                success : function(result) {                
                       alert(result);
                },
                error: function(xhr, resp, text) {
                    console.log(xhr, resp, text);
                }
            })

            });

Now After I Call My methods I want Return Values From Api MEthod , But I cant , any one Can help me ?

"parsererror" Error: jQuery112105916533075988908_1496290916990 was not called
soroushdes
  • 13
  • 7
  • Possible duplicate of [parsererror after jQuery.ajax request with jsonp content type](https://stackoverflow.com/questions/5359224/parsererror-after-jquery-ajax-request-with-jsonp-content-type) – 31piy Jun 01 '17 at 04:43
  • i saw that but i cant understand their solution @31piy – soroushdes Jun 01 '17 at 04:45
  • Please read [this answer](https://stackoverflow.com/a/11736771/2019247). It explains how JSONP works. You basically need to wrap your response in the jsonp callback function before returning it to the client. – 31piy Jun 01 '17 at 08:18
  • @31piy i did that and it workd , bye now i face with new problem , this method didnt work with https portocolo – soroushdes Jun 01 '17 at 09:59
  • Please ask a separate question for it, mentioning what errors/problems you're facing with it. – 31piy Jun 01 '17 at 10:01

0 Answers0