jQuery getJSON call not returning desired arguments?

前端 未结 5 1816
无人及你
无人及你 2020-12-07 01:25

I searched for a related topic in jQuery, but I didn\'t see any method to solve my problem.

$(document).ready(function(){
    $("#inputForm").submit         


        
5条回答
  •  执念已碎
    2020-12-07 02:09

    Are you using MVC platform? Apparently, by default MVC 2.0 blocks GET requests to actions that return a JsonResult. Check out:

    http://mhinze.com/2010/04/13/json-hijacking-in-asp-net-mvc-2/

    I had the same problem whilst upgrading an existing application (written in MVC v1) that used .getJSON calls to pull data from MVC Controller to View (via jquery/javascript) & could not figure out why they did not work I tried different versions of jquery with no luck, then I found the above link. I changed to POST instead (and also changed slightly how the data was sent from the Controller - used Dictionary ) and got it working - finally!!

    Good luck! JayD

提交回复
热议问题