Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

JavaScript Set breakpoint on loading time

hebrerillo

Active Coder
Hello there!

Sometimes, I want to locate a code that is changing a DOM element. For example, on Chrome I can set a breakpoint "On attribute modifications" for a specific DOM element, so the browser will break when such element has attribute modifications, and I can inspect the code.

However, that does not work when the attribute modifications happen on loading time. And that is my problem, because I want to locate a code that is modifying a DOM element on loading time.

How can I do that?

Thanks in advance!
 
I could be wrong but I don't think you can do that. The DOM is not guaranteed to be complete until the page is fully loaded. It seems to make sense that DOM breakpoints will not work before that.
 
Is it possible, if you create somekind of mutation observer that causes pause once something is changed. Then by checking call stack you can find what causes them? Or am i talking about something different here lol
 
Is it possible, if you create somekind of mutation observer that causes pause once something is changed. Then by checking call stack you can find what causes them? Or am i talking about something different here lol
That seems to be exactly how a data breakpoint works !? Still not going to work on a document that is not fully loaded yet, I think.
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom