One thing i can't understand about jQuery, maybe someone can explain me this.
for example: HTML:
<div>
<img class="class1" src="file.jpg" />
</div>
<div>
<img class="class2" src="file.jpg" />
</div>
jQuery:
(function ($) {
$(document).ready(function () {
$('.class1, .class2').myfunction();
});
function myfunction(param1, param2) {
var img = $('img', param1);
}
})(jQuery);
So the question is what exactly in param1 and in param2, if function has been called like that(without passing parameters to the function)?
console.log(arguments)in a function body to see the parameters being passed.myFunctionis not a property of$.fnmyfunctionproperly, there would be no params because you didn't pass any!