I have this:
$("#socialsLogin").on("click", function() {
var login = $("#socialsLoginField").val();
var passwd = $("#socialsPasswordField").val();
SocialsStart(login, password);
});
And this:
<a href="javascript:void(0)" id="socialsLogin" class="button">Disconnected</a>
And my click event is not firing up - what am I doing wrong? If I change .on() with .live(), everything works fine. But I don't want to use .live() since it is deprecated (and yes, I am using jquery 1.9)
Edit: It is not a duplicate. When I use $(document).on("click", "#socialsLogin", function() {
it works everywhere on the page - I might click on an image and it fires up. Definitely not as intended. And $(document.body).on("click", "#socialsLogin", function() {
doesn't work at all for me.
Edit2: Here's my fiddle: http://jsfiddle.net/JeDLW/1/