weixin_33670713 2014-12-10 11:26 采纳率: 0%
浏览 31

自动刷新ajax内容

I'm currently trying to design a webpage with some semi-dynamic content but I am unsure as to how to proceed.

My webpage is going to be static for most of the year, but on certain days of the year, I'd like to do a small feature with images and text that refresh in some arbitary period. I don't want to refresh the whole page, just the image/text portion. And because its on certain days of the year (which I will check with php) I don't want to have a refresh (javascript or whatever) working all year around anyway.

My original plan was to put the image/text in an iframe and have the refresh specific to that frame but then I realised that the amount of text is going to be variable and may overrun the frame, giving it scrollbars which I don't want.

So my current idea is to have the image/text content refresh via Ajax but only that part and not the whole page. But I am not sure how to do this or whether there are any better suggestions?

  • 写回答

1条回答 默认 最新

  • ??yy 2014-12-10 11:33
    关注
      setTimeout(function(){
    //Portion that you want to Refresh
    },Time); /
    

    or

    setInterval(function(){
        //Portion that you want to Refresh
        },Time);
    
    评论

报告相同问题?