In my function, I adding a class to current object. But when run again, the hasClass function doesn't detect the class I added.
So I can show a example that;
var object = {
func : function() {
if ( $(this).hasClass('myclass') )
// ...
else
$(this).addClass('myclass');
}
}
$('#myobj').on('click', object.func);
Now, I getting JSON data with AJAX. After I parsing JSON data and creating a DOM elements with this. When I click this dom elements, this function triggering successfully. Even addClass function works successfully. But when the function is triggered again, the hasClass function does not read the newly added class.
Thanks.