I tried adding my code into a fiddle and it works fine in there so please, try to analyze it straight on my site. Here is the page: http://cacharro.ole32.com/shopping/
if you go to groceries.js, at line 39 there is the code for the clic event on the #addNewSection image.
then in the page you click in the big gree + buton, a formulary will pop up, and click again in the big green + symbol. You'll notice that the code inside the .click() function is called more than once..
does anyone knows why ??
EDIT:
I found the source of my error. Y added the hooking to the event in a function called init, something like:
function init() {
$("#addNewSection").click( function(e){
newSectionButtonClicked();
});
}
and added a call in the $(function() .... BUT I also call this init() from other sites so everytime I call it a new instance of the function is hooked to the click event!! Is there a way to hook on the event only if we are not hooked already????