How is the data sent by url in jquery? I have an example in native js and I want to pass it to jquery
var f2=document.getElementById('fechaFinal').value;
window.location.href='localhost/reporte.php?f2='+f2;
How is the data sent by url in jquery? I have an example in native js and I want to pass it to jquery
var f2=document.getElementById('fechaFinal').value;
window.location.href='localhost/reporte.php?f2='+f2;
you can use the $ .get () method;
var params = {
param_1 : $("#input1_id").val(),
param_2 : $("#input2_id").val(),
....
param_n : $("#inputN_id").val()
};
$.get(URL, params, function(e){
// algo que quieras hacer despues de enviar la petición.
});
At the end of the URL the parameters are concatenated with &, and server-side you get them with the verb $ _GET, luck !!.