I'm trying to call a jQuery / Javascript function
in PHP but it doesn't work. If I replace myFunction()
with a simple alert();
it works. myFunction()
works if i call it with an onclick()
.
My code PHP :
<?php
if($_SESSION["..."] == true){
echo "<script>myFunction()</script>";
} ?>
My code JS :
<script>
function myFunction() {
content...
} </script>
Anyone has a solution for me ?