Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

592
Views
How to locate a javascript file in current webpage?

The current webpage can use ‘$CS.function_name’ to call some functions. I wonder how to find which js file does the ‘$CS’ come from?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

This action takes a bit of detective work. You'll have to learn how to use the debugger in the browser and dig into all included javascript files that your code uses. In those files, search for the reference of $CS and see if that is the original $CS you wish to track down. Inside that source file, assuming that include has the function, search for it. Once found, breakpoint it and then watch for it to be hit as you debug through your code. I had to do some detective work myself looking for a bug and eventually found it in a third-party javascript file. While the bug was minor, fixing it helped me come to a solution.

In Chrome, you can hit F12. A panel will open on the right which will give you many tools to use. Inside the SOURCES tab, you'll find the files that are being used on the web page. You'll find other windows below that give you the ability to put in breakpoints, watch variables as well as a plethora of other things. I would suggest googling "Debugging javascript using Chrome" and taking some lessons on how to debug a page using Chrome or other similar browsers.

about 4 years ago · Juan Pablo Isaza Report

0

If $CS.function_name is a function being called on a page then you must be viewing the code. If it is not declared in the current file, you will find it in the imports at the top of the file. The import statement will tell you which .js file the $CS object comes from.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!