more

ajax

class overview

  • Homework Questions
  • $.inArray()
  • Yelp API fun!

$.inArray()

  • Searches whether a given value is in an Array
  • Returns the index of the value, if found.
  • Returns -1 if not found.

 var anArray = [1,2,3,4,5];

 var threeIndex = $.inArray(3, anArray);
 //threeIndex equals 2

 var eightIndex = $.inArray(8, anArray);
 //eightIndex equals -1, because it isn't in the array

$.inArray() Documentation

yelp api fun

  • API homepage
  • No authentication needed (you're welcome)
  • Can output JSONP
    • In $.ajax(), set the dataType property to 'jsonp'
  • Returns raw results from Yelp API
  • Requests limited to 100 per hour (don't go crazy)

cool js thing for the day

Meetup
Lots of JavaScript and web meetups all around Seattle, usually completely for free.

Seattle JS
AngularJS-SEA
Ember.js Seattle
Seattle Node.js

Made with Slides.com