I have this code in which I pass a variable by url, but I need to pass another string type and for some reason it doesn't work for me.
$('#formulario').load('php/form.php?idHis='+data_form['id']);
In addition to data_form['id'], I would like to be able to pass another string variable but I don't know how.
This is the code:
tipo='1';
$('#addFact').load('php/frm_adFactura.php?id='+idHis+'&tipo='+tipo);
If the type variable is 1 it works fine, if the type variable I put 'H', it gives an error and says that H is not defined. Here I put how I collect the variable.
<?php
id=<?php echo $_GET['id'];?>;
tipo=<?php echo $_GET['tipo'];?>;
?>
Thank you and regards
You must separate each variable to send with
&
and continue concatenating with+
as you have done.Edit: because when you receive the variable , what cannot be interpreted
tipo
arrivesH
, so you must also concatenate the quotes.You can concatenate the quotes in the url or when you receive it with the
GET
1 - In the url:
2 - On the Get
Example where you see that the type variable goes like
H