• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Why isn't _this available in my callback. I see it in Closure.  RSS feed

 
ranger
Sheriff
Posts: 17314
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Especially since friendId is available and working, but in the callback _this is showing as undefined.

Thanks

Mark
 
Mark Spritzler
ranger
Sheriff
Posts: 17314
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I changed the code to work, kind of a hack, but it works



So I added an ID to the <a link and grab it via that ID, instead of it being the this to the inviteToEvent function. <br /> <br /> Mark rel="nofollow">
 
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What if you do

 
Author and ninkuma
Marshal
Posts: 66823
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
_this.toggle() won't work because _this is not a jQuery wrapped set.
 
Mark Spritzler
ranger
Sheriff
Posts: 17314
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:_this.toggle() won't work because _this is not a jQuery wrapped set.



So toggle is a JQuery method and that is why I can't call that method.

But still, I found it very odd that _this was undefined in my callback, when it was obviously declared in the outer enclosing function.

So while I wouldn't be able to call toggle(), I should still see it defined and usable with POJS, Plain Ol JavaScript.

Thanks.

I will try Eric's suggestion and see what happens.

Mark
 
author
Rancher
Posts: 15385
6
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My solution? You on drugs. I look nothing like Gregg
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Eric Pascarello wrote:My solution? You on drugs. I look nothing like Gregg



Which is unfortunate for you.
 
Mark Spritzler
ranger
Sheriff
Posts: 17314
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Eric Pascarello wrote:My solution? You on drugs. I look nothing like Gregg



Well, I thought it was a great suggestion, and besides Bear, Eric is the one with the always awesome great suggestions, so I just assumed it was Eric's.

Gregg does have some good suggestions, as long as he has had his meds that day. ;)

Mark
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!