斗士狗 2015-08-06 13:50 采纳率: 50%
浏览 50

jQuery / Ajax刷新div

Is it possible to use Jquery / Ajax to refresh a div but don't load a php file in the Jquery script?

Every jquery script I found requires a file to load but that's not possible because then my variables are not set.

<div id="reloadDIV">
<?php // PHP in here.. ?>
</div>
  • 写回答

2条回答 默认 最新

  • weixin_33682719 2015-08-06 14:02
    关注

    If you're looking to update data in the div that is being pulled from a database, Ajax could be a good approach.See here: jQuery Ajax simple call

    Then in your ajax file you just need to return the data and it will update the div. You could then use a timer function to call the ajax request periodically

    评论

报告相同问题?