Page reloading info

I there Any way that some part of our webpage don't get refreshed just like facebook chat on pageload............ It shud remain as it was....
savsoftAsked:
Who is Participating?
 
Gurvinder Pal SinghConnect With a Mentor Commented:
0
 
Gurvinder Pal SinghCommented:
Its ajax only. Page doesn't get reload, only that certain div gets reloaded.

Also, you can store the info in cookies, and fetch it when the page reloads again
0
 
savsoftAuthor Commented:
gimme some related code please
0
 
dkellnerCommented:
There are several ways to do that.
AJAX is typically for these kind of things, but there is another road to follow: IFRAME techniques.  If you use an IFRAME which is hidden (stzle="display:none"), you can push any request to the server and get whatever it gives back.  Basically, IFRAME is a small webpage inside of a webpage.

Try this:
- insert an IFRAME element, src="myalert.php"
- write myalert.php so that it prints "<script> alert(time()) </script>"
- now insert a BUTTON that reloads your iframe  - in javascript it's "myiframe.location.reload()"

You have a button now that goes to the server which returns the current timestamp.
It's a demonstration of a client-server connection, WITHOUT reloading the page itself.
No external libraries, no AJAX, no nothing.

Of course, AJAX can do more for you but it's more complex too.
0
All Courses

From novice to tech pro — start learning today.