Approach to asynchronous web programming ( Working on Google Image Labeler site look like )
I want to create a website like Google Image Labeler, in which people can tag images. but this is my first serious web programming project and my problem is that I don't know what are requirements for doing this job.
In this site what I have to do is First : pair people randomly and second : I need to send each session information to server asynchronously ( not only client to server [ AJAX ], but also server to client [ by using comet I guess ] ) I have Python and PHP programming experience and also I'm familiar with AJAX and Javascript.
In my 2, 3 days journy(!) for finding suitable tools to doing this project I encountered to lot of stuffs : websocket, jquery, comet, socke.io, nod.js and a lot more which just made me so c开发者_如何学Goonfused.in fact I'm looking for a good reference helps me on where to start and what to do. ( or you can think of it as : what is best approach for starting asnyc web programming )
thanks a lot in advanceOK, after a lots of trying I got here :
to start async web programming , first of all you need to get familiar with AJAX, it's not that hard . you can earn all you need from w3schools.
after that the best choice you have is jquery . there is lots of incredible things you can do with it . one of it's capabilities is that you can send and receive data using ajax without reloading the page . To get familiar with jquery live page manipulation you can check How to Create A Simple Web-based Chat Application.
Also you can use some of html 5 technologies such as SSE ( server sent events [ more convenient ] one directional connection ) or websockets ( bidirectional connection, useful for web game programming )
In order to pair people you can use Mysql database as a medium to hold each new user's information and after that pair them using an unique id , such as session id . obviously you can use files as a medium too .
That's almost all you need to create a live updating web site , but if you want to do it much more professionally and in the server side, you can look at node.js ( server side javascript, an event oriented programming ) or twisted ( a python frame work ).
This is all I learned in my way . Sorry for unwanted mistakes .
精彩评论