Home  >  Article  >  Web Front-end  >  Upload the user's avatar and save it with the same name. Why does the image display not change when using ajax? _html/css_WEB-ITnose

Upload the user's avatar and save it with the same name. Why does the image display not change when using ajax? _html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:44:081300browse

Do I need to clear the cache?


Reply to the discussion (solution)

Ajax is executed asynchronously, but the page does not refresh

Ajax is executed asynchronously, and the page does not refresh Refreshed

I basically understand this. After successfully uploading the image, I called an action and got an image path (of course, the image path is the same as the original; but the image content is different), and then displayed it, but the image did not change. . . . . What should I do?


Ajax is executed asynchronously and the page is not refreshed

I basically understand this. After successfully uploading the image, I called an action and got an image path (of course, the image path is the same as the original; but the image content is different), and then displayed it, but the image did not change. . . . . What should I do?
How about adding a dynamic timestamp to the image address in the background?



Ajax is executed asynchronously and the page does not refresh.


Add a timestamp to get it done. But my understanding is: Even if ajax is asynchronous and the page does not refresh, the image will be read on the server according to the path. Why does the image not change?


Ajax is executed asynchronously and the page does not refresh.


Add a timestamp to get it done. But my understanding is: Even if ajax is asynchronous and the page does not refresh, the image will be read on the server according to the path. Why does the image not change?
The image paths are exactly the same, generally the data in the cache is read first





ajax asynchronous execution , the page does not refresh


Add a timestamp to fix it. But my understanding is: Even if ajax is asynchronous and the page does not refresh, the image will be read on the server according to the path. Why does the image not change?
The image paths are exactly the same. Generally, the data in the cache is read first


Oh. . . I understand, thank you
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn