jQuery and “Organized Code”

后端 未结 8 1804
星月不相逢
星月不相逢 2020-12-12 11:52

I\'ve been struggling lately with understanding the best way to organize jQuery code. I asked another question earlier and I don\'t think I was specific enough (found in thi

8条回答
  •  没有蜡笔的小新
    2020-12-12 12:25

    Use http://coffeescript.com/ ;)

    $ ->
      container = $ '#inputContainer'
      for i in [0...5]
        $('').change ->
          $.ajax success: (data) ->
            for w in container.children()
              $(w).unbind().change ->
                alert 'duh'
    

提交回复
热议问题