Refreshing particular portion of the page using php

by 6 replies
8
Hello

I dont want to refresh whole page at time interval but iw ant to refresh particular part of the page using php. Is it possible?
#programming #page #php #portion #refreshing
  • yup, use some ajax.

    Let me google that for you
    • [2] replies
    • You can use div tag and javascript for this

      HTML Code:
      <div id="content"><p>refesh content</p></div>
      <a href="divrefresh()">Refresh</a>
      
      
      function divrefresh() {
           document.getElementById('content').innerHTML = "Div got refreshed"
      }
      You can even use ajax for this too
    • Can you show me an example how can i do it using ajax?

      Thanks in advance for any help
      • [1] reply
  • @Dr-Neo -> you contradicted yourself in the post 'you can't do this' then 'you can do this with ajax'.

    For ajax refresh div there is this example: Simple Jquery Ajax Auto Refreshing DIV | Matthew A Price

    You need to be pulling the content from an external source (usually loading a php file). In the php file you would likely be querying the database or scraping from an external website.
    • [1] reply
    • i meant he can't refresh a piece of page and this is true .
      an Ajax call won't refresh the page it will only grab the information and then using JS it will update the div content but there will no refreshing

Next Topics on Trending Feed