is this a bad / inelegant way to handle this? Would backbone or ember help me?

I have a lot of the following types of html / jquery and am wondering if there is a better way to handle it. I am trying to separate the binding of html, instantiation of object, a processing (post and calling view rendering), and a view layer that deletes out the container with the id. html: remove event capture.js: $('.remove-item').click(function(){ var l=get_remove_item($(this)); process(l); // this does the posting based upoint values in objectction }); object-creation.js: function get_remove_item(v){ t={}; t.action='remove-item'; t.global_id=v.data('global-id'); console.log(t); return t; } process.js: function process(l){ // will post the data var f_name = s.replace (/-/g,"_"); // replace space or comma by underscore f_name=f_name + "_view"; var str=window[f_name](r); } view.js: remove_item_view(){ // go back and delete out container with global_id value } Is there a better way to do this? Would backbone or ember handle this better? In what way? thx

以上就是is this a bad / inelegant way to handle this? Would backbone or ember help me?的详细内容,更多请关注web前端其它相关文章!

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

评论 抢沙发

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

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

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏