I am new to asp.net and frontend technologies in general. I have the following code:

<ul>
    @foreach (var item in Model)
    {
        <li>
            <img src="@item" alt="file here" width="100" height="100" />
            <a id="@item" href="#" onclick="deleteFile('@item');">Delete</a>
        </li>
    }
</ul>

<script>
    function deleteFile(item) {
        var url = "/Home/DeleteFile";
        $.post(url, { Name: item }, function (data) {
            window.location.href = "/Home/Upload";
        });
    }
</script>

I know we can recognize the language in which the script is written by the type tag. E.g.

<script type="text/javascript"...

But without this type specified, how can I recognize the language of the script? Further in the script, what is the argument "function(data)" in the post statement doing and where is the data argument for that function coming from?

Thanks!

Related posts

Recent Viewed