Author Topic: AJAX - The Chat Demo  (Read 1253 times)

0 Members and 1 Guest are viewing this topic.

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
AJAX - The Chat Demo
« on: April 29, 2013 »
A few people have been throwing around the idea of a PHP / JavaScript demo, and the first thing that popped into my head was the use of AJAX.

It is possible to hook the AJAX output into a canvas at the client side, and a database on the server side.

Users should then be able to post messages to the database (like a shout box) which are read back in real time into the canvas, which applies effects to the text, such as rendering it as cubes or some other inventive method.

I'll see how far I can run with this idea.
You are our 9001st visitor.
Challenge Trophies Won:

Offline Clanky

  • Laser Guided Memories
  • Amiga 1200
  • ****
  • Posts: 340
  • Karma: 16
  • kiss that sound that pounds your senses
    • View Profile
    • Facebook
Re: AJAX - The Chat Demo
« Reply #1 on: June 11, 2013 »
Could having an interval check calling AJAX to grab the posts from the database work? Once you have have the JSON (or a plain response) you can push those posts to the Canvas Object? Shouldn't be too hard? You could employ simple 2D polygons to give the impression of a cube and use transformations on the text to get it positioned on the cube. Or, you could use WebGL and create a proper 3D cube on the Canvas. WebGL also offers wider effects for text, shapes, graphics etc.

Have you thought of using HTML5 Web Sockets to act as a tunnel from the client to server, which would eliminate the need for AJAX and an Interval. It allows for proper real-time data streaming.
He tilts, and his eyes are focused on the ground far below.. Wind? Angels? Men..

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: AJAX - The Chat Demo
« Reply #2 on: June 12, 2013 »
Good ideas - I'll look into webGL.

My current host won't let me use server sockets, but I'll see what I can do with a LAN setup just to test them.
You are our 9001st visitor.
Challenge Trophies Won: