I am trying to update data on my webpage using AJAX. The idea is when a user clicks a checkbox the data will be updated.
This is the code that I have so far:
Expand|Select|Wrap|Line Numbers
- <script type="text/javascript">
- var refreshData = function() {
- asdf
- };
- $('input[type=checkbox]').live( 'click', refreshData );
- </script>
- <input type="checkbox" id="checkbox_<?= $statistic_id; ?>" <?= $i==0 ? 'checked="checked"' : null; ?> onclick="refreshData()" />
For your reference, I am pulling data from this source: http://tyrone.pae.me/pulldata.php?p=1&s=40 where p is a player id number and s is a statistic associated with the player. You'll notice that I reference a statistic_id in the id of the checkbox. Not sure if that is helpful or not.
If you have any ideas on how this can be achieved or need more information, please reply to this thread. Thanks!