Skip to content

Instantly share code, notes, and snippets.

@mfifth
Created March 6, 2017 19:09
Show Gist options
  • Select an option

  • Save mfifth/8af1465fb8abdcbad2f6573f38ac91b4 to your computer and use it in GitHub Desktop.

Select an option

Save mfifth/8af1465fb8abdcbad2f6573f38ac91b4 to your computer and use it in GitHub Desktop.
$(document).on('submit','#weekly-pitch-count',function(e){
$('.processing-reports-wrapper').show();
var data = $('#weekly-pitch-count').serialize();
$.ajax({
data: data,
type: 'post',
url: '/app-dashboard/get-pitch-count',
success: function(data){
// console.log('profile here');
console.log(data);
var total_pitches = 0;
$.each(data, function(i, item) {
console.log(item)
total_pitches = total_pitches + item.total_pitches;
});
get_county_by_type('Game');
get_county_by_type('Warm Up');
get_county_by_type('Lesson');
get_county_by_type('Practice');
get_county_by_type('Workout');
$('.weekly-pitch-count').html(total_pitches + ' pitches');
$("")
}
});
return e.preventDefault();
//return false;
});
var data = "pitcher_id=96&start_date=08%2F23%2F16&user_id="
// This is the variable on line 3. I need to create a link with that data which looks kinda like this.
// /shares/share_content/pitch-tracker-widget/{data.pitcher_id}/{data.start_date}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment