Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7729683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:01:49+00:00 2026-06-01T06:01:49+00:00

How to know which Javascript (.js) executed a GET or Ajax call using Firebug

  • 0

How to know which Javascript (.js) executed a GET or Ajax call using Firebug or Google Chrome Plugin?

For example, a request for a image or html file executed by a Javascript, how to know which Javascript on the page executed that

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T06:01:51+00:00Added an answer on June 1, 2026 at 6:01 am

    Update:

    I have to (shamefully) admit that the original below was wrong. Due to the nature of the js execution flow this works at the first execution time:

    console.log($("script").last().attr("class")); //or whatever
    

    That, however, is not good enough, as illustrated by a call on a timeout. We need to keep the reference to the script element, this can be achieved by wrapping script contents into a closure and creating a variable to store the jQuery reference:

    (function(){
        var $scriptElement = $("script").last();
        console.log($scriptElement.attr("class")); //or whatever
    })();
    

    Now, I have to disclaim that with the markup as above it is unlikely to be practical unless you come up with a better way to store the script element reference… this pretty much became a rather bad example of what could be done but really shouldn’t 🙁

    Unless you have to get the reference in-code, you would be much better off looking at the console output, it actually tells you where the output originated from, with the line# and everything:

    enter image description here

    Original:

    Not sure how applicable this would be to external js (script tag with a src), but for inline scripts you could do something like this w/jQuery:

    $(this).closest("script");//gets you reference to the script element
    

    I’m assuming it would just a matter of getting its src attribute! Let us know if it works.

    console.log($(this).closest("script").attr("src"));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying in javascript to convert an integer (which I know will be
Is there a ActionScript-version of JavaScript's Canvas.clearRect()? I only know graphics.drawRect(...) which allows me
General javascript question here, which would also be good to know how(if possible) to
I'd like to know which method is recommended on Windows C programming: using malloc
I have one webpage (lets call it A.html). A.html has some javascript which switches
to know which Apps are installed on a given device i have followed the
is it possible to know which facebook user clicked on a link that a
I would like to know which dependency described in my pom.xml brings a transitive
I want to know which tool can be used to measure the cyclomatic complexity
I'd like to know which libraries are used by executables on my system. More

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.