Html代码
1. <html>
2. <head>
3. <script>
4. function test(){
5. .src="xxx1.jpg?v="+new Data();
6. //这里在ie浏览器下,可能会有缓存,所以加入时间参数,来防止缓存,在firefox,ie下都测试通过
7. }
8. </script>
9. </head>
10. <body>
11. <img src="xxx.jpg" id="img" onclick="test()">
12. <body>
13. </html>