vade vade - 6 months ago 12
AngularJS Question

Can I use javascript library codes inside HTML file instead of referencing it?

Is it possible to copy and paste a javascript library's code inside a HTML file?

I asked because I'm trying to make an app that needs angularjs but due to restrictions at work, I cant reference it to an angularjs file externally regardless if its over the internet or intranet.

I appreciate your help.

Thanks

Answer

Yes this is possible but very much not recommended.

This can be done the following way using the <script> tag:

<body>
    <p>This is HTML bla bla bla...</p>
</body>
<script type="text/javascript">
    //Put your JS code here
</script>