Welcome Guest, Not a member yet? Register   Sign In
poll with ajax question
#1

[eluser]A.M.F[/eluser]
hi guys

i built a poll, and i want to sopice it up a little bit wiyh ajax, so i want to show the results of the poll when a user votes, without refreshing the whole page. - this is with ajax, right?

so, where do i need to start? i allready built the poll, i just need to add the ajax stuff. is there an ajax library for CI? do u have any tips for me? ideas maybe?

thank u!
#2

[eluser]ciscoheat[/eluser]
I would recommend jQuery for AJAX and DOM-manipulating stuff. Here's a good page with both a jQuery and ajax tutorial: http://www-128.ibm.com/developerworks/li...query.html

It's a quick and quite dirty solution, but if you have a page that returns proper html from a request, this is all jQuery you need to attach that html to a html element:
Code:
$('#elementId').load('stats/update/parameters');
Here's the load function documented: http://docs.jquery.com/Ajax/load#urldatacallback

/Andreas
#3

[eluser]A.M.F[/eluser]
thank u andreas, i will try to use jQuery for that.

does anyone have any examples of using CI+DB+jQuery?

cheers!
#4

[eluser]Grahack[/eluser]
It uses Scriptaculous but I liked the way iheartrant is coded. See this discussion.
You've got a nice and simple AJAX voting system with stars. Source code is here.




Theme © iAndrew 2016 - Forum software by © MyBB