hello. im not sure if this is the right forum because it is about php echo AND js but since it is about echoing i thought this forum will be better. sorry if i asked in the wrong forum.
Anyway, so i want to know if echoing a js script will work? Like for instance as usual we write js in <head> but if it were to be echoed, is that something that is done?
i was thinking of echoing a script for datetimepicker plugin.
i tested this:
echo "<script src='js/jquery 1.8.2.js'></script>";
echo "<script src='js/jquery-ui 1.8.2.min.js'></script>";
echo
"<script type='text/javscript'>
$(document).ready(function(){
$(\"#button\").live(\"click\", function(){
alert(\"click\");
});
});
</script>";
nothing happens on click though, so is it not allowed or something?
yes, im using an older version of js when i can just use the latest and .on() but i will upgrade soon.
TIA!