Question

I am editing this repo on github https://github.com/thiswolf/ttf_html5/tree/gh-pages and i have run into a problem.This is the live page http://thiswolf.github.io/ttf_html5/

The problem is,once i click add partner the partner is added but when i try clicking delete partner nothing happens.What should happen is that,i should get a dialog saying i clicked something.

This is the jquery code

https://github.com/thiswolf/ttf_html5/blob/gh-pages/admin_panel.js

Since the alert does not appear,i have concluded there might be an error somewhere but that error isn't being shown on firebug and i wonder what the problem could be.

Was it helpful?

Solution

Use $(document).on('click', '.delete_partner', function(){ instead. This will bind the event to the document. The way you've declared the function means that it will not bind to dynamically created '.delete_partner' elements; it will only bind to existing '.delete_partner' elements which are at present when the document is ready.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top