Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
jquery + json + flickr, ajax spinner while loading

 
Post new topic   Reply to topic    mi3dot.org Forum Index -> Client-side
View previous topic :: View next topic  
Author Message
fanatic



Joined: 02 Nov 2004
Posts: 81
Location: vienna

PostPosted: 16.06.2010 12:12    Post subject: jquery + json + flickr, ajax spinner while loading Add user to your forum ignore list Reply with quote

Pozdrav,

koristim ovu jednostavnu jquery funkciju za parsanje flickr feed-s, radi bez problema. Ono sto bih rado dodao ovome je ajax spinner koji bi se vrtio za vrijeme loadanje feeda. Zna netko kako?

Code:
$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?id=35068899@N03&format=json&jsoncallback=?",
function(data){
  $.each(data.items, function(i,item){
      var imglink = item.link;
     var imgsrc = item.media.m.replace(/_m/i, "_s");
   var imgtitle = item.title;
    $('<a href="'+ imglink +'"><img src="'+ imgsrc +'" /></a>').appendTo("#flickr-images");
    if ( i == 5 ) return false;
  });
});
Back to top
View user's profile Send private message
maratz
mi3.crew


Joined: 24 Nov 2003
Posts: 1208
Location: ZAG

PostPosted: 16.06.2010 12:56    Post subject: Add user to your forum ignore list Reply with quote

http://api.jquery.com/jQuery.getJSON/
Code:
$.ajax({
  url: url,
  dataType: 'json',
  data: data,
  success: callback
});


success se događa kada je učitano, što znači da tada možeš ukloniti spinning wheel,
koji si prethodno na onclick postavio kao bg image elementa u koji učitavaš podatke

_________________
STOP HITTING YOURSELF! | NETIQUETTE | TYPETESTER | Hypertext rulez™ | CREATIVE NIGHTS | ACCOMMODATIONS
Back to top
View user's profile Send private message Visit poster's website Twitter profile
fanatic



Joined: 02 Nov 2004
Posts: 81
Location: vienna

PostPosted: 16.06.2010 15:12    Post subject: Add user to your forum ignore list Reply with quote

super, hvala!

uzgred, treba li dati prednost server-side rjesenju (PHP) ili je ovo takodjer stabilno i robusno rjesenje? Namjeravam na ovaj nacin parsati Facebook, Youtube, Flickr & Twitter feed-ove...
Back to top
View user's profile Send private message
maratz
mi3.crew


Joined: 24 Nov 2003
Posts: 1208
Location: ZAG

PostPosted: 16.06.2010 15:47    Post subject: Add user to your forum ignore list Reply with quote

Server-side ispis je pristupačan svima, dohvat JavaScriptom nije.

HTML koji ti ispiše server je bolji izbor za slabije strojeve, jer dohvat JS-om + pokoji efekt
može opteretiti procesor posjetioca.

_________________
STOP HITTING YOURSELF! | NETIQUETTE | TYPETESTER | Hypertext rulez™ | CREATIVE NIGHTS | ACCOMMODATIONS
Back to top
View user's profile Send private message Visit poster's website Twitter profile
fanatic



Joined: 02 Nov 2004
Posts: 81
Location: vienna

PostPosted: 16.06.2010 16:43    Post subject: Add user to your forum ignore list Reply with quote

jasno, hvala na odgovoru!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    mi3dot.org Forum Index -> Client-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group