我正在使用Rails3作为我的后端,Jammit使用资产......现在我试图不压缩甚至打包.
简单事件不会运行,但警报('asd')int inialize正在按预期工作.
我已经在其他对象中尝试了其他类型的事件,但它没有用.
我的代码如下:
var InvoiceStock = Backbone.View.extend({
initialize: function(args) {
_.bindAll(this, 'find_product', 'product_added');
this.products = new ProductCollection();
this.products.bind('add', this.product_added);
alert('asd');
},
events: {
"keypress #product_finder": "find_product"
},
find_product: function(e) {
alert('teste');
},
product_added: function(product) {
alert('pqp4');
}
});
Run Code Online (Sandbox Code Playgroud)
和我的RUBY HTML:
<%= text_field 'search', :isbn_or_isbn10_or_publisher_or_authors_or_name_like, :id => 'product_finder' %> ou
<%= link_to 'criar um produto', '', :id => 'new_product_link' %>.
Run Code Online (Sandbox Code Playgroud)
产生这个:
<label>Adicionar</label>
<input id="product_finder" class="ui-autocomplete-input" type="text" size="30" name="search[isbn_or_isbn10_or_publisher_or_authors_or_name_like]" autocomplete="off" role="textbox" aria-autocomplete="list" aria-haspopup="true">
ou
<a id="new_product_link" href="">criar um produto</a>
Run Code Online (Sandbox Code Playgroud) 我有一个jQuery UI对话框,可以在我的应用程序上显示一个窗口.此窗口在IE7,IE8,FF和chorme中正确显示,但在IE9上无法正常工作.当我点击应打开对话框的链接时,没有任何反应.
有人可以帮帮我吗?
$('#open_chat').click(function() {
$('#chat').dialog({
width: 422,
resizable: false,
title: '<img align="absmiddle" src="/img/icone_chat.png"> Chat <span>(clique e arraste para movimentar)</span>'
});
return false;
})
Run Code Online (Sandbox Code Playgroud)