Javascript Assignment

Hi,  I am new to javascript and and got  an assignment, and I have to submit it in a day.  Please help....My assignment is :-

Please write a code using javascript that searches flickr and displays the top 2 results as image(or save the image on disk).

You have to use this flickr api: http://www.flickr.com/services/api/
TechJoshiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RobOwner (Aidellio)Commented:
Ok first off we can't do the assignment for you.  Happy to guide you along the way though.

What have you got so far?

This will help you get started, have a read here: http://www.flickr.com/services/api/response.json.html
0
TechJoshiAuthor Commented:
Hi, thanks for the response. As I mentioned that I dont know much about Javascript. I use the following code with the help of google,

<div>
 
  <p> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script></p>
</div>

<div>
  <h1>Show Picture App</h1>
  <p>
  <script type="text/javascript">

  function showpics(){

    var pic= $("#box").val();
    $.getJSON('http://api.flickr.com/services/feeds/photos_public.gne?tags='
      +pic+"&tagmode=any&format=json&jsoncallback=?",
      function(data){ $("#images").hide().html(data).fadeIn('fast');

    $.each(data.items, function(i,item) {

      if(i==2)
      {
            return false;
      }
      
      $("<img/>").attr("src", item.media.m).appendTo("#images");
      
    });
  })
};
  </script>
</p>
</div>


<div>
  <h1>Browser Images</h1>
  <p>
    <p>Enter the keyword for the images </p>
    <input id="box" type="text">
    <input id="Button" title="show" onclick="showpics()" type="button" value="show">
    <div id="images"></div>
  </p>
</div>

And it is working fine. How to make a "Send" button in the same code to send keyword of image as well as image and thumbnail of image to a Database API? Please help
0
RobOwner (Aidellio)Commented:
Ok first things first. What did your assignment say about the use of jQuery? Or do you have to use the standard structures?
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

TechJoshiAuthor Commented:
There is no such compulsion of standard structure. JQuery can be used.
0
RobOwner (Aidellio)Commented:
ok, and why did you not put the inclusion of jquery in the <head> section of the page?
0
RobOwner (Aidellio)Commented:
Good to see you've got something working and it seems that would satisfy your assignment?
What do you mean by database API?
0
TechJoshiAuthor Commented:
Actually images should be select-able, and there has to be a button "send", which will send the url of the selected images (and images) to a particular address. What should I do to achieve this?
0
RobOwner (Aidellio)Commented:
You would look at attaching an event listener 'click' to the image.  Easily done with jquery and the .on() function.
keep track of what images are clicked by using .toggleClass() function with a class such as "clicked".  

Then when you're button is clicked you can get all the images that have that "clicked" class with the .each() function.  You'll be able to get their URLs to send whereever you want.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.