Javascript examples for jQuery Method and Property:ajax
Reload an image using ajax
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-git.js"></script> <script type="text/javascript"> $(window).on('load', function() { $('button').click(function() { var unique = $.now();/*from w w w. j ava2s. c om*/ $('img').attr('src', 'http://www.java2s.com/style/demo/Safari.png' + unique); }); }); </script> </head> <body> <img src="http://www.java2s.com/style/demo/Opera.png"> <button type="button">Refresh</button> </body> </html>