Skip to content

can not access the element on which function is called #779

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zeeeuu opened this issue Oct 14, 2018 · 1 comment
Closed

can not access the element on which function is called #779

zeeeuu opened this issue Oct 14, 2018 · 1 comment

Comments

@zeeeuu
Copy link

zeeeuu commented Oct 14, 2018

[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 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

@dmethvin
Copy link
Member

This is a good StackOverflow question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants