This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • 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
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

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

 
ranger
Posts: 17344
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
Posts: 17344
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

 
Marshal
Posts: 67226
169
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
Posts: 17344
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
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
Posts: 17344
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
 
I was born with webbed fish toes. This tiny ad is my only friend:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!