Skip to main content
Specify drupal version
Source Link
Mrweiner
  • 2k
  • 4
  • 26
  • 49

I'm creating a system on D7 that tracks how much progress users have made watching various videos on the site. I've set up the jQuery that stores the percentage progress in an array with a modified version of the process at https://www.urbaninsight.com/2014/10/06/tracking-progress-embedded-vimeo-videos. Where I'm lost is where I actually post the data using:

$.post('/callback', { progress: myProgressVariable });

I realized that '/callback' is just a placeholder, but I don't know what to sub in there. Should I designate a callback() function in a custom module that does something with the progress data and just place the function name into the javascript -- and what might that look like? Or do I need to do something something else entirely?

I'm creating a system that tracks how much progress users have made watching various videos on the site. I've set up the jQuery that stores the percentage progress in an array with a modified version of the process at https://www.urbaninsight.com/2014/10/06/tracking-progress-embedded-vimeo-videos. Where I'm lost is where I actually post the data using:

$.post('/callback', { progress: myProgressVariable });

I realized that '/callback' is just a placeholder, but I don't know what to sub in there. Should I designate a callback() function in a custom module that does something with the progress data and just place the function name into the javascript -- and what might that look like? Or do I need to do something something else entirely?

I'm creating a system on D7 that tracks how much progress users have made watching various videos on the site. I've set up the jQuery that stores the percentage progress in an array with a modified version of the process at https://www.urbaninsight.com/2014/10/06/tracking-progress-embedded-vimeo-videos. Where I'm lost is where I actually post the data using:

$.post('/callback', { progress: myProgressVariable });

I realized that '/callback' is just a placeholder, but I don't know what to sub in there. Should I designate a callback() function in a custom module that does something with the progress data and just place the function name into the javascript -- and what might that look like? Or do I need to do something something else entirely?

Source Link
Mrweiner
  • 2k
  • 4
  • 26
  • 49

jQuery post data to the database?

I'm creating a system that tracks how much progress users have made watching various videos on the site. I've set up the jQuery that stores the percentage progress in an array with a modified version of the process at https://www.urbaninsight.com/2014/10/06/tracking-progress-embedded-vimeo-videos. Where I'm lost is where I actually post the data using:

$.post('/callback', { progress: myProgressVariable });

I realized that '/callback' is just a placeholder, but I don't know what to sub in there. Should I designate a callback() function in a custom module that does something with the progress data and just place the function name into the javascript -- and what might that look like? Or do I need to do something something else entirely?