Returning JSONP instead of JSON from a JSP

前端 未结 3 823
梦毁少年i
梦毁少年i 2021-01-22 20:06

I found this question on setting the response type to json from a jsp but I\'m in need of setting the response type to jsonp for cross-domain access. Would it still be this:

3条回答
  •  甜味超标
    2021-01-22 21:04

    To support cross-domain access in javascript you can use $.support.cors = true;
    Other than that you can set content-type to application/javascript for jsonp.

提交回复
热议问题