Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 923 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Javascript :

Ajax Request - jQuery

Thread title: Ajax Request - jQuery
Closed Thread    
    Thread tools Search this thread Display Modes  
03-05-2008, 08:48 PM
#1
crazyryan is offline crazyryan
Status: I love this place
Join date: May 2006
Location:
Expertise:
Software:
 
Posts: 603
iTrader: 6 / 100%
 

crazyryan is an unknown quantity at this point

  Old  Ajax Request - jQuery

Hey

What I want to do is have something like:
Did this work: Yes - No
Success Rate: 65%

When someone clicks yes, it'll turn the Did this work line into thank you and the success rate will then automatically update with the new success rate.

If someone refreshes the page then I'll use php to check if they have clicked yes or no before.

I'm having trouble with the ajax of that, everything about it. The PHP I can do, I just don't know how I need to show the percentage and stuff.

Could anyone help me complete this task? All help is appreciated, thank you.

03-05-2008, 08:52 PM
#2
Jeff Andersen is offline Jeff Andersen
Status: Superstar
Join date: Apr 2005
Location:
Expertise:
Software:
 
Posts: 4,449
iTrader: 10 / 100%
 

Jeff Andersen is on a distinguished road

  Old

I'm not familiar with javascript, but the percentage would still be PHP.
And it would depend on how you're storing the percent in the database (whether when someone clicks yes and you're recalculating the average out of 100%). It's all math from that point.

03-05-2008, 08:54 PM
#3
Gurnk is offline Gurnk
Status: Member
Join date: May 2007
Location: US
Expertise:
Software:
 
Posts: 380
iTrader: 12 / 100%
 

Gurnk is on a distinguished road

Send a message via AIM to Gurnk Send a message via MSN to Gurnk

  Old

I can't specifically help you, but I recently saw a jQuery tutorial that may help you.

http://www.webdesignerwall.com/tutor...for-designers/

03-05-2008, 08:56 PM
#4
crazyryan is offline crazyryan
Status: I love this place
Join date: May 2006
Location:
Expertise:
Software:
 
Posts: 603
iTrader: 6 / 100%
 

crazyryan is an unknown quantity at this point

  Old

What I mean by how I show the percentage is if its just pure text or what. I have no problem with the PHP side, it's just the jquery side.

03-05-2008, 09:00 PM
#5
Im A Web Dev is offline Im A Web Dev
Im A Web Dev's Avatar
Status: Junior Member
Join date: Mar 2008
Location:
Expertise:
Software:
 
Posts: 39
iTrader: 3 / 100%
 

Im A Web Dev is on a distinguished road

Send a message via MSN to Im A Web Dev

  Old

Well, jQuery is really easy to learn. I'm telling you because I was in a situation like yours and after reading a few code snippers, I could manage myself to make my script.

just read the jQuery documentation, it's really good to start.

08-29-2008, 03:12 AM
#6
versatiletech is offline versatiletech
Status: I'm new around here
Join date: Jan 2007
Location: Orlando, FL
Expertise:
Software:
 
Posts: 11
iTrader: 0 / 0%
 

versatiletech is on a distinguished road

Send a message via Yahoo to versatiletech

  Old

$.Ajax() docs: http://docs.jquery.com/Ajax/jQuery.ajax

in your success function use the html() or text() in the following manner:

success: function (data) {
$('#percentage-box').html(data);
}

08-29-2008, 04:35 PM
#7
bgolat is offline bgolat
Status: I love this place
Join date: Mar 2005
Location:
Expertise:
Software:
 
Posts: 714
iTrader: 0 / 0%
 

bgolat is on a distinguished road

Send a message via ICQ to bgolat Send a message via AIM to bgolat Send a message via Yahoo to bgolat

  Old

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed