Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-28-2008, 08:57 AM   PM User | #1
Pezmc
New Coder

 
Join Date: Jan 2007
Posts: 13
Thanks: 5
Thanked 0 Times in 0 Posts
Pezmc is an unknown quantity at this point
Question Ajax Posting

I can currently using starbox and an ajax event to save a users rating on a video they have seen. However I also need to post the id of the video to the back end php.
How can I do this? What is the safest way to do this as well so I can prevent the user from modifying the js?

Code:
<html>
<link rel="stylesheet" type="text/css" href="css/starbox.css" />
<script src='js/prototype.js' type='text/javascript'></script>
<script src='js/scriptaculous/scriptaculous.js?load=effects' type='text/javascript'></script>
<script src='js/starbox.js' type='text/javascript'></script>
<script type="text/javascript">
document.observe('starbox:rated', saveStar);
function saveStar(event) {
  new Ajax.Request('savestar.php', {
    parameters: event.memo.rating + '&id=1',
    onComplete: function() {}
  });
}
</script>
	<div class='star'>
			<div id=star><img src='images/loading.gif' alt=''/></div>
			<script language='javascript' type='text/javascript'>
		    new Starbox('star', 5.6011, { overlay: 'pointy.png', className: 'pointy', identity: 'star', max: 8, buttons: 8, stars: 8, total: 5, indicator: '#{average} average after #{total} votes'} );
		  	</script>
	</div>
</html>
I have tried this but I don't know why it doesn't work. I can pick up the id variable but not the rated variable.
Code:
parameters: event.memo.rating + '&id=1',
I hope you can help.
Pezmc is offline   Reply With Quote
Old 08-30-2008, 05:33 PM   PM User | #2
Pezmc
New Coder

 
Join Date: Jan 2007
Posts: 13
Thanks: 5
Thanked 0 Times in 0 Posts
Pezmc is an unknown quantity at this point
Bump.
Pezmc is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:37 AM.


Advertisement
Log in to turn off these ads.