Hello,
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:
I am having trouble building the refreshData function because I am very unfamiliar with AJAX. The AJAX function would primarily consist of building the ajax query and then executing the ajax query and then taking the returned data and displaying it
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!
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:
Code:
<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!
Comment