jQuery¼¼Êõ

Öð²½±àдһ¸öjQuery²å¼þ(todoify)(2)

×ÖºÅ+ ×÷ÕߣºH5Ö®¼Ò À´Ô´£ºH5Ö®¼Ò 2017-11-16 14:01 ÎÒÒªÆÀÂÛ( )

$("#thing-input").todoify({ container: "#thing-todos", template: "sectionheader%= todo %/headeraremove/a/section", renderItem: function(item) { var cont = this.renderTemplate(item); cont.find("a").cl

$("#thing-input").todoify({ container: "#thing-todos", template: "<section><header><%= todo %></header><a>remove</a></section>", renderItem: function(item) { var cont = this.renderTemplate(item); cont.find("a").click(function(event){ cont.remove(); }); return cont; } });

½øÒ»²½¸Ä½ø

Ä¿Ç°£¬todoify»¹Ã»ÓÐÓëºǫ́½øÐÐÈκεÄͨÐÅ£¬Èç¹û¿ÉÒԺͺǫ́µÄRESTFulµÄAPI¼¯³ÉµÄ»°£¬Õâ¸ö²å¼þ½«»áÓиü¶àµÄʹÓó¡¾°¡£

¼òµ¥À´½²£¬Ö»ÐèҪΪ²å¼þÌṩ¸ü¶àÑ¡Ï²¢Ìṩ»Øµ÷º¯Êý¼´¿É£¬±ÈÈ磺

$("#input").todoify({ restful: 'http://app/todos', onadd: function(item){ //... }, ondelete: function(item){ //... } })

È»ºó¼ÓÈëһЩajaxµÄµ÷Óü´¿É¡£



¡¡

1.±¾Õ¾×ñÑ­ÐÐÒµ¹æ·¶£¬ÈκÎתÔصĸå¼þ¶¼»áÃ÷È·±ê×¢×÷ÕߺÍÀ´Ô´£»2.±¾Õ¾µÄÔ­´´ÎÄÕ£¬ÇëתÔØʱÎñ±Ø×¢Ã÷ÎÄÕÂ×÷ÕߺÍÀ´Ô´£¬²»×ðÖØÔ­´´µÄÐÐΪÎÒÃǽ«×·¾¿ÔðÈΣ»3.×÷ÕßͶ¸å¿ÉÄܻᾭÎÒÃDZ༭Ð޸Ļò²¹³ä¡£

Ïà¹ØÎÄÕÂ
  • ÿ¶Èµç̼ÅÅ·ÅÁ¿½ö230¿Ë ÏÂÒ»¸öÀÍ˹ÍßµÂȼÆøµç³§»á²»»áÔÚÖйú£¿

    ÿ¶Èµç̼ÅÅ·ÅÁ¿½ö230¿Ë ÏÂÒ»¸öÀÍ˹ÍßµÂȼÆøµç³§»á²»»áÔÚÖйú£¿

    2017-11-12 17:21

  • jqueryµ÷ÓÃÁíÍâÒ»¸öfunction·½·¨

    jqueryµ÷ÓÃÁíÍâÒ»¸öfunction·½·¨

    2017-10-24 10:13

  • jqueryÈçºÎ»ñÈ¡Ò»¸ö¶ÔÏó

    jqueryÈçºÎ»ñÈ¡Ò»¸ö¶ÔÏó

    2017-10-16 10:03

  • С½Ì³Ì£º×Ô¼º´´½¨Ò»¸öjQuery³¤ÒõÓ°²å¼þ

    С½Ì³Ì£º×Ô¼º´´½¨Ò»¸öjQuery³¤ÒõÓ°²å¼þ

    2017-08-19 12:02

ÍøÓѵãÆÀ
¼