简体   繁体   中英

how to debug javascript in partial view in mvc

partial view Department

<div>This is deva</div>
<div id="divRead"></div>

@section scripts
{
    <script src="~/Scripts/jquery-1.9.1.min.js"></script>
    <script>
        $(document).ready(function () {
            debugger;
            $('#divRead').html('<b>This is append debugger</b>');
        })
    </script>
}

Department Action in Account controller

public PartialViewResult Department()
        {
            return PartialView();
        }

Register.cshtml in Account controller

@Html.Partial("Department")

how to debugger the jquery in partial view.?

<div>This is deva</div>
<div id="divRead"></div>

@section scripts
{
    <script src="~/Scripts/jquery-1.9.1.min.js"></script>
    <script>
        $(document).ready(function () {
            debugger;
            $('#divRead').html('<b>This is append debugger</b>');
        })
    </script>
}

give the debugger on where you want to debug. and run the application. after you have to inspect the chrome then it will display in VM3232 then we have to use the debug.

like below: 在此处输入图片说明

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM