Why is this simple jQuery not working?

I have this jQuery get request: $.get($(this).attr("href"), { "searchExpression": "schroders" }, function (result) { // do stuff }, "html"); Which sends the get request to this Action Method: public PartialViewResult Tabs(string searchExpression) { return PartialView(new SearchViewModel { PagedFunds = _fundService.GetFunds(searchExpression) }); } The `$.get` request sends a request to the `Tabs` method, but `searchExpression` is always an empty string. I've done this before and it's worked.. does anyone have any idea why either the data isn't being sent or the Model Binder isn't working? **edit:** I've just discovered the version of jQuery being used is 1.2.6. Also, There's another JS framework being used on the site - Prototype, I think - so this is the complete function that I'm using for the GET, which manages the compatibility issues: jQuery(document).ready(function ($) { $('.ActionControl a').click(function () { $.get($(this).attr("href"), { searchExpression: "schroders" }, function (result) { // do stuff }, "html"); return false; }); }); does this offer any clues? Thanks

以上就是Why is this simple jQuery not working?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准