如何通过jQuery刷新一个div? [英] How to Refresh a Div by Jquery?

查看:60
本文介绍了如何通过jQuery刷新一个div?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要通过jQuery刷新页面中的一个div

I need to Refresh a Div in Page by Jquery

<? if($POST['id']) :?>
<script>
    Refresh script
</scriptt>

<?php ednif;?>

<div class="Refresh-Div">
           <span> Some Dynamic Content </span>
</div>

推荐答案

我仍然不确定您要寻找的是什么,但是根据您对问题的评论,您需要这样的东西:

I'm still not entirely sure what you are looking for, but based on your comments on the question, you want something like this:

$(".Refresh-Div").load("someScript.php");

这是jQuery load函数的最简单形式,该函数仅将someScript.php返回的内容加载到class="Refresh-Div"元素中,以替换之前的内容.

That is the simplest form the the jQuery load function, which simply loads whatever is returned by someScript.php into the element with class="Refresh-Div", replacing whatever was there before.

如有必要,您可以使用load函数做更多的事情(例如传递数据和回调函数),因此,有关更多信息,我建议阅读load部分. api.jquery.com/load/"rel =" nofollow> jQuery API .

You can do more with the load function if necessary (like pass in data, and a callback function), so for more information I suggest reading the load section in the jQuery API.

这篇关于如何通过jQuery刷新一个div?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆