0

I use php in my JavaScript code to print a JavaScript line but I have an error. what am I doing wrong?

<?php  
    if (isset($_GET['dateSelected'])) {
        echo '$("#eliminarCitaBtn").attr("href", "index.php/agenda/eliminarCita/"+event.cita_id+"/?agendaId='.$_GET["agendaId"].'&dateSelected='.$_GET["dateSelected"].');';
    } else {
        echo "$('#eliminarCitaBtn').attr('href', 'index.php/agenda/eliminarCita/'+event.cita_id+'/?agendaId=".$_GET['agendaId'].");";
    }
?>
Kirill Simonov
  • 8,257
  • 3
  • 18
  • 42

1 Answers1

0

You are't closing the quotes at the end of either attr().

There '");'; and there "');";

Gabriel
  • 2,170
  • 1
  • 17
  • 20