Is it possible to do something like this?
@{var list = [1,2,3,4,5]; }
I do not boot error but then when I want to use that variable in Jquery, it does not appear.
What is the correct way to do it?
Is it possible to do something like this?
@{var list = [1,2,3,4,5]; }
I do not boot error but then when I want to use that variable in Jquery, it does not appear.
What is the correct way to do it?
It is possible to scroll through the list in the javascript array
<script type="text/javascript">
var list = [1,2,3,4,5];
@foreach (var d in list)
{
@:myArray.push("@d");
}
alert(myArray);
</script>