SHARE
TWEET

Wordpress Flickr AJAX example

w0lfiesmith Mar 3rd, 2013 327 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type="text/javascript">
  2. jQuery(document).ready(function($){
  3.         $.ajax({
  4.                 url: "http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?",
  5.                 type:"get",
  6.                 dataType:"json",
  7.                 data:{
  8.                         tags:"<?php $tagslist = get_the_tags();foreach($tagslist as $tag){echo $tag->name.",";}?>",
  9.                         tagmode:"any",
  10.                         format:"json"
  11.                 },
  12.                 success:function(data,textStatus){
  13.                         console.log(data);
  14.                 },
  15.                 error:function(message){
  16.                         alert(message);
  17.                 }
  18.         });
  19. });
  20. </script>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top