Solved

Page reloading info

Posted on 2011-09-17
4
237 Views
Last Modified: 2012-05-12
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....
0
Comment
Question by:savsoft
  • 2
4 Comments
 
LVL 40

Expert Comment

by:gurvinder372
ID: 36553680
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
 

Author Comment

by:savsoft
ID: 36553718
gimme some related code please
0
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 500 total points
ID: 36553721
0
 
LVL 3

Expert Comment

by:dkellner
ID: 36556438
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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question