Reputation: 2711
I am getting an error on this, what have I missed?
My Code:
$function(){
$(".product-add-link").on("click", BindAddProduct);
}
Firefox says:
missing ; before statement
Chrome says:
unexpected token {
Upvotes: 1
Views: 175
Reputation: 10698
You forgot parenthesis :
$(function(){
$(".product-add-link").on("click", BindAddProduct);
});
The shortcut $(function(){})
is an equivalent of document.ready(function(){});
.
Please refer to this post for further informations
Upvotes: 3
Reputation: 22619
jQuery $
accepts a function as parameter
. You missed (
for passing your function.
Please try below
$(function(){
$(".product-add-link").on("click", BindAddProduct);
});
Upvotes: 2