[英]How to debug a script inside partial view that load by javascript in Chrome Developer Tools?
當我使用以下代碼加載包含javascript代碼的html文件時
$( “#數據筒”)負載( “@ Url.Action(” ActionName “)”)。
我在chrome來源標簽中找不到該文件,發現chrome將js加載的文件重命名為“ VM27123”之類,每次刷新更改的數字,chrome不會在搜索結果中顯示這些文件
那么如何找到它們並在其上設置斷點?
使用語法:
//# sourceURL=fileName.cshtml
打開腳本標記后立即進行。 例:
<script type="text/javascript">
//# sourceURL=fileName.cshtml
function foo() {}
</script>
並且您可以通過fileName在調試模式下的“源”選項卡中找到您的javascript
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.