如何调试中的jsfiddle的JS [英] how to debug the js in jsfiddle

查看:103
本文介绍了如何调试中的jsfiddle的JS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在看这个的jsfiddle: http://jsfiddle.net/carpasse/mcVfK/
它的工作原理罚款是没有问题的,我只是想知道如何通过JavaScript的调试。我试图用调试器的命令,我不能找到它的源标签?
任何想法我怎么能调试吗?

从小提琴一些code:

  angular.module('应用',['appServices'])
    的.config(['$ routeProvider',函数($ routeProvider){
        $ routeProvider。
                当('/家',{templateUrl:home.html做为',控制器:HomeCtrl})。
                当('/列表',{templateUrl:list.html',控制器:的ListCtrl})。
                当('/细节/:ITEMID',{templateUrl:detail.html',控制器:DetailCtrl})。
                当('/设置,{templateUrl:settings.html',控制器:SettingsCtrl})。
                否则({redirectTo:'/家'});
}]);


解决方案

从字面上加字调试; 来您的JavaScript和Chrome将在这一点上打破

添加

 调试;

http://jsfiddle.net/mcVfK/111/

请注意,您必须拥有调试控制台(F12)打开它击中前调试程序;致电或将无法正常工作。

I am looking at this jsfiddle: http://jsfiddle.net/carpasse/mcVfK/ It works fine that is not the problem , I just want to know how to debug through the javascript. I tried to use the debugger command and I cant find it in the sources tab? any idea how I can debug this?

some code from the fiddle:

angular.module('app', ['appServices'])
    .config(['$routeProvider', function($routeProvider) {
        $routeProvider.
                when('/home', {templateUrl: 'home.html',   controller: HomeCtrl}).
                when('/list', {templateUrl: 'list.html',   controller: ListCtrl}).
                when('/detail/:itemId', {templateUrl: 'detail.html',   controller: DetailCtrl}).
                when('/settings', {templateUrl: 'settings.html',   controller: SettingsCtrl}).
                otherwise({redirectTo: '/home'});
}]);

解决方案

Literally add the word debugger; to your javascript and Chrome will break at that point

Added

debugger;

http://jsfiddle.net/mcVfK/111/

Note you must have the debugging console (F12) open before it hits the debugger; call or it won't work.

这篇关于如何调试中的jsfiddle的JS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆