Updating the button text

Now the last thing we're going to do is update the button text while the process is occurring. To get that done over inside of Atom we're going to use that text method we've used in the past.

In the locationButton.attr line, we're going to set the text property equal to, by calling text, Sending location.... Now, in the index.js file, the real button text is Send Location, I'm going to go ahead and lowercase location that to keep things uniform:

var locationButton = jQuery('#send-location');locationButton.on('click', function (){  if (!navigator.geolocation){    return alert('Geolocation not supported by your browser.');  }  locationButton.attr('disabled', 'disabled').text('Sending location...');

Now that we have this set ...

Get Advanced Node.js Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.