OldCode101

JQuery / JSON / Yahoo Placefinder

Jun 8th, 2011
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.45 KB | None | 0 0
  1.  
  2. // http://where.yahooapis.com/geocode?location=San+Francisco,+CA&flags=J
  3. // http://where.yahooapis.com/geocode?location=68118&flags=J
  4. */
  5.  $.getJSON('http://where.yahooapis.com/geocode?location=San+Francisco,+CA&flags=J', function(data){
  6.   var items = [];
  7.   $.each(data, function(key, val) {
  8.     items.push('<li id="' + key + '">' + val + '</li>');
  9.   });
  10.   $('<ul/>', {
  11.     'class': 'my-new-list',
  12.     html: items.join('')
  13.   }).appendTo('body');
  14. });
Add Comment
Please, Sign In to add comment