Bob Schneider
asked on
AJAX Won't Fire
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks. I don't get an error now but it doesn't update either. Note that I am using an asp variable for series in this format: <%=leriesID%>. Is that a problem?
ASKER
getData(<%=lSeriesID%>, categories, gender)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have been tinkering and I changed my approach to try to avoid that. Is mixing asp variables with javascript/ajax considered good practice or not good practice?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have reworked it to avoid that. Page opens and loads once but then does not load when I make other changes in the selects. No errors. Any ideas?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I did that and it appears it is being built properly.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I've tried putting it in a couple of places and got a datatable error "Cannot reinitialize...". Can you show me where to reinitialize it please?
<script type="text/javascript">
$(document).ready(function () {
var categories = 0;
var gender = '';
var series = 0;
$('#series,#categories,#gender').on('change', function () {
categories = $('#categories').val();
gender = $('#gender').val();
series = $('#series').val();
getData(series, categories, gender)
});
var dt = null;
function getData(series, categories, gender) {
var url = '/series/results_array-new.asp?series_id=' + series + '&gender=' + gender + '&age_to=' + categories;
if(dt) {
dt.ajax.url(url).reload(); // http://datatables.net/reference/api/ajax.reload()
return;
}
dt = $('#standings').dataTable({ 'ajax': url });
}
});
</script>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Wow! Thank you very much.
ASKER