I have a small part of a paticular script that I can't understand, Can you help?
- { widget_id : $(widget).attr('id'), fetch: 1 };
This the paticular line I have truoble with. The script is from a 5 star rating system that does not use a database.. I got the script from
here because I am new to JS so I got a head start.
I have my own Active video list beside the Flash player. I have the video list entries numbered and I want that number to set the stars that should be displayed.
e.g. Watching Video no. 1
See the Stars for Video no. 1
This script uses the id tag "r1", "r2" and I want to change that to "1", "2", "3" etc.
- <div id="r1" class="rate_widget">
On my html page:
I have a tag inside an A tag that has the .class="playing" so I can id the Video that is being watched using that. But I can't pull the existing script apart so I can put the new bit in..
In this script where is the id="r1" ? Is it a variable because I can't find it..
- $(document).ready(function() {
$('.rate_widget').each(function(i) {
var widget = this;
var out_data = { widget_id : $(widget).attr('id'), fetch: 1 };
$.post(
'ratings.php',
out_data,
function(INFO) {
$(widget).data( 'fsr', INFO );
set_votes(widget);
},
'json'
);
});