views:

51

answers:

2

I want to implement a feature like in twitter where when new tweets show up the title changes. How to display the record when the record has just been created.

+1  A: 

Changing the title requires JS to manipulate the DOM. I am not sure I know what you are asking in the second part of the question though. "How to display the record...."

Are you asking how you would update a client browser when a new record is saved? i.e. in Browser A a user creates a record and you want Browser B to be aware of it a display it?

If that is what you are asking you will need to have a JS timer that periodically asks the server all new records since id=X. The response will either be an empty array or an array of record information. (or HTML, it is up to you really)

Then dynamically change the page with the new data.

Will
A: 

I think i have the same questions as Will.

But I would send a create a js poll to send request to the backend with the time of page creation.. and then query database with records created after this time.

so1o