JavaScript Modify the IMG tag src, in the IE6 below the picture to modify the normal, but in IE7 and Firefox below but do not refresh, there is a solution, we can refer to the following
1. When clicked a button, the picture domain picture changes the code as follows: Unclear </span> <script> function Reflush () {document.getElementById (randimg). src= "/servlet/ Createvalidatenum "; </script> 2. Description "Servlet/createvalidatenum" is a Java-written servlet. The servlet is printing out a picture of 3. The problems that appear in the IE6 below are modified normally, but are not refreshed under IE7 and Firefox 4. Situation analysis If the new picture is not the same as the old picture address, the effect will come out. That is: The picture has changed. But like the "Captcha" feature. The address of the old and new pictures is the same. In view of the above, it is suspected that the image address is the same, causing the browser to read the cache automatically. 5. The solution is to change the JavaScript to this way: document.getElementById (randimg). src= "/servlet/createvalidatenum?" +math.random (); That is: Each access address is not the same, because there is a random number. So the problem is solved