I have image library that is provisioned by publishing feature, I added the view of this library to the page which contains my custom web part with jQuery

After this I have an error
TypeError: $(...).attr is not a function
on line
var attrValue = $(this).attr('attrName'); Without images view web part works correctly. How can I solve this issue?
$(function() { .... });block?