0
I am trying to call a function by clicking on a link, where a parameter is passed that will be used in an Ajax request.
This request will return results that will be added to a div.
The link code with the function call is as follows:
<a href="javascript:;" id="Iniciais" onclick="pBuscaFichaEmergencia('<?php echo $Letra; ?>');"><?php echo $Letra; ?></a>
The function code is:
function pBuscaFichaEmergencia(){
var Iniciais = $('#Iniciais').val();
console.log("INICIAL: " + Iniciais);
if (Iniciais) {
var url = 'pBuscaFichasLetras.php?Iniciais='+Iniciais
$.get(url, function(dataReturn) {
$('#resp-emergencia').html(dataReturn);
});
}
}
You can explain better what should happen?
– Sergio
Hello @Sergio, when passing the value of the parameter of the variable "Initials" to the page "pBuscaFichasLetra.php" would make the query and return a formatted response in an html table positioned in the emergency divResp, but I cannot pass the value of this variable.
– adventistapr
Which part does not work? on the server or browser?
– Sergio
What doesn’t work is in the Browser.
– adventistapr