dongxing8009 2013-12-19 18:51
浏览 119
已采纳

重新加载页面上的图像重新加载

I have a button that reloads the page:

<input type="button" name="reloadPage" id="reloadPage" value="Refresh Data" onclick="location.href = '<?=$Domain?>unitstatus.php";/>

But all of the .gif images on the page do not reload. Is there any way to make them reload when the button is clicked?

<img src="images/10frame.gif";>

The above is the image that doesn't reload when the page reloads. The .gif image stays at the last frame and does not start at the beginning frame.

  • 写回答

2条回答 默认 最新

  • dongping6974 2013-12-19 19:22
    关注

    The answer above works, but is overly complex. Just using this code will resolve the issue

    <img src="images/10frame.gif?<?PHP echo uniqid(); ?>">
    

    This will add a querystring to the end of the url for the image and bypass any caching by the browser.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 表达式必须是可修改的左值
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
  • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)
  • ¥50 mac mini外接显示器 画质字体模糊
  • ¥15 TLS1.2协议通信解密
  • ¥40 图书信息管理系统程序编写
  • ¥20 Qcustomplot缩小曲线形状问题