jQuery with EJS
You need to put your jQuery <script>
before the other. Otherwise $
is not yet defined.
The Browser loads every script one after the other. Say we had scripts A and B.B use something from A, then A should be before B or it wouldn't work.
TL;DR
Change this:
<script type='text/javascript'> $(function(){ alert('inside jquery'); }); </script><script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
To this:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script><script type='text/javascript'> $(function(){ alert('inside jquery'); });</script>