Mazel:test: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
No edit summary
No edit summary
Line 7: Line 7:
             function(data) {
             function(data) {
                            
                            
 
                          var paps = [];
                           $.each(data, function(pap) {
                           $.each(data, function(pap) {
                                 var items = [];
                                 var items = [];
Line 13: Line 13:
                                             items.push('<li id="' +key + '">' + val + '</li>');
                                             items.push('<li id="' +key + '">' + val + '</li>');
                                 }
                                 }
                                 $('<ul/>', {
                                 paps.push(items.join('');
                                        'class': 'my-new-list',
       
                                          html: items.join('')
                                          }).appendTo('#papers');
                           });
                           });
                          $('<ul/>', {
                              'class': 'my-new-list',
                              html: paps.join('')
                          }).appendTo('#papers');


                            
                            

Revision as of 06:24, 7 March 2011

<html> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() {

 $.getJSON('http://www.citeulike.org/json/group/5581?callback=?', 
           function(data) {
                          
                          var paps = [];
                          $.each(data, function(pap) {
                                var items = [];
                                $.each(pap, function(key,val){
                                            items.push('<li id="' +key + '">' + val + '</li>');
                                }
                                paps.push(items.join('');
       
                          });
                          $('<ul/>', {
                              'class': 'my-new-list',
                              html: paps.join('')
                          }).appendTo('#papers');


            });

});


document.writeln("coucou"); </script>

<a href="">Link</a> <div id="papers"></div> <div id="images"></div> </html>