T
T
Talyan2018-03-24 09:11:52
JavaScript
Talyan, 2018-03-24 09:11:52

How to catch a line with a function adding .append("tr") to a table?

There is a page for ordering goods, and a pop-up basket. The whole thing was written in simpleCart JS, which adds products not by their ID from the database, but stupidly by name. I've been fiddling with the code all night.
Achieved that when adding a product to the cart, its real ID is added to localStorage.
But! I just can’t catch and find the line in the script that actually inserts a new TR into the order form table. I can't, because the shop script is over 8 thousand lines, and the code in the script looks something like this:

i && (a += 1, e["on" + n + "_" + r] = o, e["os" + n + "_" + r] = t))

Tell me some debugger for JS, which can put a breakpoint in the script, execute it in the browser and find the function called before the desired event.
Or to trace in what functions the variable is transferred. Because I tracked the variable itself among these thousands of lines of code.
That bish: somewhere in the script something like:
cart_form.table.tr.append(input) is called with a prepared variable for sending.
Where exactly, I have no idea. Consloe.log has already riddled the entire script.
I have never debugged JS, but here it’s just necessary for a single case - and I’m not boom-boom.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Simonov, 2018-03-24
@flapflapjack

You can debug in Chrome
Write debugger; in code

var a = 1;
debugger;
var b = 2;

Go to the page press f12 and wait for the script to hit the breakpoint

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question