I’m sure I’m doing alot wrong here, but specifically I’m trying to pull some info from a form and combine it into a url I can then .load():
$(document).ready(function() {
origin = $('#origin').val();
destination = $('#destination').val();
weekDay = $('#weekday').val();
fullSchedule = origin+'_'+destination+'_'+weekDay+'.html';
$("#scheduleform :submit").click(function() {
$('#schedule').load(fullSchedule);
alert( fullSchedule );
});
});
I can alert the full URL but I can’t seem to get it to load in the div (with the id of schedule).
I am basically hobbling together what little jquery I know to make this, so I’m sure it’s messy, but I’m just not sure why it would alert properly but not load the div.
If you have Firebug, can you verify that the request is going to the server and that you’re getting a response? Also try putting a callback in
loadto see if the load is completing successfully:A few other things:
I noticed one other thing. Is there any reason that you’re using
click()instead ofsubmit()? So:Another way to get around the whole submit business is just to use a standard button that is not a submit button, and bind
clickto it (depending on what you’re actually doing of course — I don’t know if you actually want to submit anything).