in the fiddle on line 147 when i try to do console.log(this) then it gives the window object not the element which is passed in the function call on line 166 $('#loadImage').loadImage() with the id loadImage. It leads to bind a click event handler on the whole window but not on the element. It means event fires when where ever i click on the page. so my problem is why i am not able to access the element but window object at line 147
[a simple jquery plugin ] (https://jsfiddle.net/28jof5th/4/)
in the fiddle on line 147 when i try to do
console.log(this)
then it gives the window object not the element which is passed in the function call on line 166$('#loadImage').loadImage()
with the idloadImage
. It leads to bind a click event handler on the whole window but not on the element. It means event fires when where ever i click on the page. so my problem is why i am not able to access the element but window object at line 147