开发者

Matching user input texts with that in the database like sporcle?

I am developing a site for my school's techfest. I intend to put a quiz section in which i would like to put up sporcle like quizes where the text from user will be compared with that stored in the database. It's fairly simple using Ajax. I did long polling (jquery) but my problem is that i want to check the user input instantly (using ajax it takes like 1-3 secs for matching text with database). I want to do the job instantly like that in sporcle.

Guys can anyone he开发者_如何学JAVAlp me out ? Is my approach wrong ? Any idea how sporcle does the thing ? (in my database(mysql) i have a column with the answers in it and i am using php for the server side script) Any help would be appreciated.Thanks


Add a handler to the change event of input box.
Using Jquery:

$('#my-input-text-box').change(function(event){
//Your CODE TO post to server goes here
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜