Nov Esk Eduard Nov Esk Eduard - 10 months ago 41
Javascript Question

token illegal; PHP inside javacript code

i use php in my javascript code to print a javascript line but i have an error, what am I doing wrong?? help me please

<?php if (isset($_GET['dateSelected'])) {

echo '$("#eliminarCitaBtn").attr("href", "index.php/agenda/eliminarCita/"+event.cita_id+"/?agendaId='.$_GET["agendaId"].'&dateSelected='.$_GET["dateSelected"].');';

echo "$('#eliminarCitaBtn').attr('href', 'index.php/agenda/eliminarCita/'+event.cita_id+'/?agendaId=".$_GET['agendaId'].");";



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

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