I found the reason; Razor engine encodes the < and > characters so the browser throws JS compile error:
The solution is simple:
1- Wrapping inside the < script> < /script> tags with <! -- -->
2- Using @Html.Raw("<") instead of <
<script>
<!--
...
// i < len; // Replace this line as below
i @Html.Raw("<") len;
...
-->
</script>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.