I have two ajax functions and use the first one to pass some data to the second however when I look at the POST, I see that for the variable I am being sent I am getting object Object returned as the value of the variable and not what I was expecting either a string or an int. The javascript looks like this,
$('.career_select .selectitems').click(function(){
var selectedCareer = $(this).attr('title');
$.ajax({
type: 'POST',
url: '/roadmap/step_two',
data: 'career_choice='+selectedCareer+"&ajax=true&submit_career=Next",
success: function(html){
$('.hfeed').append(html);
$('#grade_choice').SelectCustomizer();
}
});
});
$('#grade_choice_options .selectitems').live('click', function(selectedCareer){
var selectedGrade = $('#grade_choice_customselect').val();
$.ajax({
type: 'POST',
url: '/roadmap/step_two',
data: 'career_choice='+selectedCareer+'&grade='+selectedGrade+"&ajax=true&submit_grades=Next",
success: function(html){
window.location.replace("/roadmap/your_map");
}
});
});