weixin_33712987 2011-06-16 23:56 采纳率: 0%
浏览 28

jQuery / Ajax冲突rails3

I'm currently using rails3 with jquery-plugin

I've been successfully using datepicker in my application however, I've just added some js from railcast 240 for ajax search. In my application.js file, I have the following:

$(function() {
  $("#orders th a, #orders .pagination a").live("click", function() {
    $.getScript(this.href);
    return false;
  });
  $("#orders_search input").keyup(function() {
    $.get($("#orders_search").attr("action"), $("#orders_search").serialize(), null, "script");
    return false;
  });

$("#order_installationdate").datepicker({dateFormat: 'yy-mm-dd'});
  $("#order_orderdate").datepicker({dateFormat: 'yy-mm-dd'});
  $("#milestone_milestone_due").datepicker({dateFormat: 'yy-mm-dd'});
  $("#milestone_milestone_completed").datepicker({dateFormat: 'yy-mm-dd'});
  $("#task_dueddate").datepicker({dateFormat: 'yy-mm-dd'});
  });
});

However there seems to be a conflict between the two. I can have either or but not both together.

  • 写回答

1条回答 默认 最新

  • weixin_33716941 2011-06-17 00:22
    关注

    There's a syntax error on the second-to-last line in your JS. There's a }); on a line by itself that doesn't appear to match anything.

    Your indentation is a bit messed up, so it's not too easy to spot.

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#网络安全#的问题:求ensp的网络安全,不要步骤要完成版文件
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥20 使用Photon PUN2解决游戏得分同步的问题
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序