I've seen/read plenty advocating "unobtrusive" JavaScript contained in separate files. I'm preparing to combine all my JavaScript from three partial views into a single file that I will then reference somewhere in my master.
My question is: is there any type of JavaScript that should remain behind in the html? One example that seems to me may present a problem would be something like:
<script type="text/javascript">
$(document).ready(function () {
$('#newQuoteLink').click(function () {
$('#newQuoteLink').hide();
$('#newQuoteDiv').load('/Quote/Create/<%:Model.Book.BookID%>');
return false;
});
});
</script>
--in particular the
<%:Model.Book.BookID%>
Am I correct in assuming this script would not work if loaded from a separate file?
I mostly wanted to check if there were any caveats or other considerations prior to combining everything into this lone, separate file.
Thanks in advance.