推荐关注
Meteor
JSLint - a JavaScript code quality tool
jsFiddle
D3.js
WebStorm
推荐书目
JavaScript 权威指南第 5 版
Closure: The Definitive Guide
gaohongyuan

想查看点击后调用的 JS 函数,但是在 Chrome 控制台里找不到该函数

  •  
  •   gaohongyuan · Oct 22, 2015 · 4820 views
    This topic created in 3882 days ago, the information mentioned may be changed or developed.

    刚才一位高中同学(女生)找我帮忙,说想批量下载一个网站上的图片。她有一串关键字,需要依次把它们输入到网站的搜索框,然后点击搜索结果上的「下载」按钮。我上去看了一下,发现那个下载按钮在网页代码里是这么写的:

    http://i.imgur.com/5US8a7R.jpg

    查了一下, ng-click 貌似是 AngularJS 里的,意思是点击后会执行引号里面的表达式。但这个表达式是说执行 quickDownload 这个函数吗?可是我在 Console 里输入函数名,提示:

    Uncaught ReferenceError: quickDownload is not defined

    自己才疏学浅经验匮乏,不知这种定位函数的方法是否有问题?见笑了,希望大家指点一下啊。非常感谢~

    7 replies    2015-10-22 23:20:52 +08:00
    jarlyyn
        1
    jarlyyn  
       Oct 22, 2015   ❤️ 1
    当前$scope 里才行。
    zomco
        2
    zomco  
       Oct 22, 2015 via iPhone   ❤️ 1
    可以给 click 事件打断点
    astrayV2
        3
    astrayV2  
       Oct 22, 2015 via Android   ❤️ 1
    看看控制台有没有 angular

    angular.element($0).scope() 里面应该能找到 quickDownload
    chairuosen
        4
    chairuosen  
       Oct 22, 2015   ❤️ 1
    你应该把完整的需求贴出来。有这功夫脚本都写完了
    hronro
        5
    hronro  
       Oct 22, 2015   ❤️ 1
    chrome 下载 AngularJS Batarang 插件之后才方便调试 angular
    adspe
        6
    adspe  
       Oct 22, 2015   ❤️ 1
    在 controller 里面的$scope.xxxx = function(){}
    crab
        7
    crab  
       Oct 22, 2015
    ctlr+shift+F 搜索那几个参数名称
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1194 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 17:48 · PVG 01:48 · LAX 10:48 · JFK 13:48
    ♥ Do have faith in what you're doing.