debug JS code which triggers an alert()

后端 未结 3 731
心在旅途
心在旅途 2021-02-07 23:18

I have a system which is built using the ext-js library. Part of the system lists orders that are flowing through an online store. When a row is clicked, additional order detail

3条回答
  •  迷失自我
    2021-02-07 23:57

    If you are able to recreate it, you can just put a break point at the line where the alert appears and view the stack trace and figure out the path.

    If you can not recreate it, you need to find where the alert is coming from. After that look what calls that method and see what values need to be set. Walk your way up the path until you find the click event.

    There is no real answer on debugging JavaScript since every application is coded differently. A lot of time it is manual labor of walking through code and figuring out what path it takes. Adding watches, console.logs, and alerts will be your friend in figuring out variable states. Add break points and walk through the code.

提交回复
热议问题