I've voting mechanism
in my website, if user tries to vote(up or down)
I'll check whether he logged-in or not, for that I've written following code,
$(".vote").click(function(){
if(is_logged_in)
{
// Doing necessary stuff for vote up/down
}else
{
// Showing Login Dialog box
submitForm(".lform",function(response){
if(data.status == "1")
{
//Closing the Login Dialog Box
is_logged_in = 1; // Assigning the value
bindEvent(".vote","click"); // Binding the Event,but can't able to it
}
});//Form Submission Closed
}// Else Closed
});// Main 'click' closed
function bindEvent(selector,eventType){
$(selector).bind(eventType);
}
Instead of external function bindEvent(".vote","click")
I've tried without the bindEvent()
, but I can't able to bind the click event
dynamically after successful login.