Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1004455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:08:12+00:00 2026-05-16T08:08:12+00:00

I’m just getting started with jQuery. I was using it to make a photo

  • 0

I’m just getting started with jQuery. I was using it to make a photo gallery that pulls photos and their information from Flickr. The script is shown below

<html>
<head>
    <title>Flickr Test</title>

<script src="http://rhol.squarespace.com/storage/js/jquery.js" type="text/javascript"></script>
<script src="http://rhol.squarespace.com/storage/js/fancybox/jquery.fancybox-1.3.1.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="http://rhol.squarespace.com/storage/js/fancybox/jquery.fancybox-1.3.1.css" media="screen" />



<script>
$.getJSON("http://api.flickr.com/services/rest/?method=flickr.photosets.getInfo&api_key=db05e5f5e5c2151218cc06545aaae27e&photoset_id=72157624591740770&format=json&jsoncallback=?",
    function(data2){
    $("#setName").text(data2.photoset.title._content);
    $("#setDesc").text(data2.photoset.description._content);
    });
    $.getJSON("http://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=db05e5f5e5c2151218cc06545aaae27e&photoset_id=72157624591740770&format=json&jsoncallback=?",
        function(data1){
            $.each(data1.photoset.photo, function(k,item){
                var baseurl = 'http://farm'+item.farm+'.static.flickr.com/'+item.server+'/'+item.id+'_'+item.secret;
                $("<tr><td id=\"image"+k+"\"><a> </a></td><td id=\"desc"+k+"\"></td></tr><tr />").appendTo("#images");
                $("#image"+k+" > a").attr("href",baseurl + "_b.jpg").attr("rel","mylightbox[photoset]").attr("class","gallery");
                $("<img/>").attr("src",baseurl+'_m.jpg').appendTo("#image"+k+" > a");
                $("a.gallery").fancybox({'titlePosition':'inside'});
                $.getJSON("http://api.flickr.com/services/rest/?method=flickr.photos.getInfo&api_key=db05e5f5e5c2151218cc06545aaae27e&photo_id="+item.id+"&format=json&jsoncallback=?",
                function(data2){
                    $("#desc"+k).text(data2.photo.description._content);
        $("#image"+k+" > a").attr("title",data2.photo.description._content);
                });
            });
        });
</script>

</head>
<body>
    <a name="top"></a><br />
    <h1 id="setName"></h1>
<h3 id="setDesc"></h3>
    <br />
<table id="images">
</table>
    <a href="#top">top</a>
</body>

My problem is that this script seems to lock up the browser if there are too many photos. What I wanted to do was have it load say 50 photos and then have another page with another 50. However, I wasn’t sure how to make each start with the 50th item in the json object instead of the first. I was able to make it stop at 50 by having it return false when k == 50. If someone could give me an example of how to do this using each I’d appreciate it. Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T08:08:13+00:00Added an answer on May 16, 2026 at 8:08 am

    As you have a Javascript array rather than a jQuery object, you use the slice method in the array class instead of the slice method in jQuery:

    $.each(data1.photoset.photo.slice(50, 100), function(k,item){
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.