mardi 14 avril 2015

Pass question mark url with Ajax load in a div

I have a simple Ajax-load function that loads another php file into a div '#content_box' via a form. The month and year parameters are determined by respectively #dm and #dy. The submit button has passed the id #ds. I was wondering, what is the best way to pass these parameters to the browser url (i.e. how to obtain an url such as http://ift.tt/1CWY8Ip )?



$(document).ready(function(){
$('#df').submit(function(){
var month_ddchart = $('#dm').val();
var year_ddchart = $('#dy').val();
source_ddchart = '/data/ddc-'+month_ddchart+'-'+year_ddchart+'-body.php';
$('#content_box').load(source_ddchart);
event.preventDefault();
});
});

Aucun commentaire:

Enregistrer un commentaire