url - jQuery POST redirects to http://127.0.0.1:8080/MyApp/[object Object] -


in jquery post request, url gets directed local host (with message http://127.0.0.1:8080/myapp/[object object] )

with jquery works fine (connects external url).

how can change post behavior access specified url?

var tmpurl='https://myhost.com/message'; $.post({   data: {    'v': value,    'key' : 'mykey'   },   datatype: 'jsonp',   url: tmpurl,   success: function(response) {   console.log("success!", response);    } });  

since making ajax call on https, recommend have / @ end /message/. crossdomain requests use crossdomain: true.

var tmpurl='https://myhost.com/message/'; $.post({   data: {    'v': value,    'key' : 'mykey'   },   crossdomain: true,   datatype: 'json',   url: tmpurl,   success: function(response) {   console.log("success!", response);    } });  

that should solve problem.


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -