Results 1 to 3 of 3
Thread: jQuery + JSON
Hybrid View
-
25th April 2011 08:46 #1
jQuery + JSON
!
, , , , , . slideshow . jQuery javascript , - .
:
, FireBug-a , changePic() . .Code:<html xmlns="http://www.w3.org/1999/xhtml"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <head> <title>jQuery</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> </head> <body> <button id="change">Press Me!</button> <script> $('#change').click(function() { $.getJSON('json-db.html', function(data) { setInterval('changePic()', 1000); function changePic() { for(var i = 0; i < data.images.length; i++) { $('div').remove('imga'); var image = data.images[i]; $('#resultDiv') .append('<img id=' + '"' + 'imga' + '" ' + 'src=' + '"' + image.source + '" ' + "alt=" + '"' + image.alternative + '"' + ' />'); } } }); }); </script> <div id="resultDiv"></div> </body> </html>
..: , ...
-
25th April 2011 12:00 #2
.
<script>.Hey, mother, I come bearing a gift. I'll give you a hint. It's in my diaper and it's not a toaster.
.
-
25th April 2011 12:34 #3




Reply With Quote
Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in