Well you can use something like this:
foreach (var item in collection) {
<script type="text/javascript">
JK();
</script>
}
If you need to use foreach inside the javascript code, you should just use . Like this:
<script type="text/javascript">
@foreach (var item in collection) {
<text>JK();</text>
}
</script>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…