繁体   English   中英

在PHP中重新加载页面以显示图像

[英]Reload Page In PHP To Display Image

我在PHP中有这样的代码:

<div class="row" id="buttons">
<?php
    for ($i = 0; $i < $n; $i++) {
        $path = 'miniatura' . $camera_array[$i]['cameraId'] . '.jpeg';
        $fp = fopen($path, 'w');
        fwrite($fp, $get_miniature);
        fclose($fp);
        echo '<div class="thumbnail" style="float:left;display:inline;" id="little"><img src="' . $path . '"/></div>';
    } 
?>
</div>

我想用我的代码重新加载DIV以在5秒内刷新图片。 在Internet上,我找到了JQuery load()方法并编写了以下JavaScript:

<script type="text/javascript">
    var auto_refresh = setInterval(
    function ()
        {
            $('#buttons').load(location.href+ " #little");
        },5000);
</script>

但这是行不通的。 怎么了? 请帮忙。

尝试删除" #little"之前的" #little"

$('#buttons').load(location.href+ "#little");

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM