Solved

Page reloading info

Posted on 2011-09-17
4
211 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
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…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now