motoku
motoku

Reputation: 1581

How can I download new content in a HTML script?

How can I download new content in a HTML script? More specifically, I'm looking for a way to update a page without it being completely reloaded. I have searched Google to no avail. Most probably I don't know the proper search query to enter.

My home project is a chat site with "lazy loading" or "infinite scrolling" content from input of its users.

Two side questions: Is the best application for this project PHP, Java, or something else? How is a Javascript paused without blocking?

Upvotes: 0

Views: 95

Answers (3)

Manny
Manny

Reputation: 6287

The proper search query is "ajax".

Normally one would use PHP for your requirements, but I would suggest to use a programming language you are already comfortable with. I.e. if you already know Java then use it.

For a "techy-er" chat app, you may research on "server push"

Upvotes: 1

SUDO Los Angeles
SUDO Los Angeles

Reputation: 1635

Making a chat script will require some kind of server side language, I highly recommend PHP. The combination of ajax/PHP should give best results. Json long polling is also good

Upvotes: 0

jwueller
jwueller

Reputation: 30996

AJAX/XMLHttpRequest is what you are looking for. A small example using JavaScript/jQuery:

$('#some-container').load('http://example.com/');

PHP is probably the way to go here. Asynchronous calls in JavaScript are implemented using callback functions.

Upvotes: 0

Related Questions