Can I write my razor code in javascript like this:
<script type="text/javascript">
$(document).ready(function () {
alert("test");
@if (Model != null)
{
foreach (var item in Model)
{
alert(item);
}
}
});
</script>
I'm getting a error that alert is not defined