Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

How to use .bindPopup from Leaflet from within ajax $.get call?

1) I'm using Leaflet to create markers on a map. The markers are created from a 'click' inside a table row. This step works.

2) For each marker, I make an ajax get call to run a web service to return a json object. I need to access the data from the object AND use .bindPopup to bind the results to the popup marker. New to ajax. How can I call a function inside "success" to give me the data and bind it to the existing marker from step 1?