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

  • SEARCH
  • Home
  • 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 8764789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:07:14+00:00 2026-06-13T16:07:14+00:00

I have changed my coding style with more complex projects to loading pages (And

  • 0

I have changed my coding style with more complex projects to loading pages (And their embedded scripts) “on demand” recently. However, it is difficult to debug those scripts as when they are loaded like:

jQuery.get('/myModularPage', function(html){ /* insert the loaded page into the DOM */ });

or

$('#some-container').load('/myOtherPage');

These scripts run perfectly, but if I’m debugging, how can I set breakpoints in these dynamically loaded pages and scripts?

  • 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-13T16:07:15+00:00Added an answer on June 13, 2026 at 4:07 pm

    UPDATE

    The accepted form is now with a # (hashtag) rather than @ (at symbol)

    The syntax was changed to to avoid conflicts with IE conditional compilation statements and some other issues (thanks to Oleksandr Pshenychnyy and Varunkumar Nagarajan for pointing this out)

    //#sourceURL=/path/to/file 
    

    This can really be any string that helps you identify the block of code.

    An additional good point from JMac:

    For me, the js file was being displayed in the sources list within a
    group called “(no domain)”. Might be worth mentioning as I missed it
    at first!

    ORIGINAL

    I struggled with the above for about a week before running across this article. It really does work perfectly for my development environment (Chrome 22 as I write this).

    Firebug also supports developer-named eval() buffers: just add a line to the end of your eval(expression) like:

    //@ sourceURL=foo.js
    

    For example, given this simple html document:

    <!DOCTYPE html>
    <html>
    <body>
        <p>My page's content</p>
        <div id="counter"></div>
        <script type="text/javascript">
            //if this page is loaded into the DOM via ajax 
            //the following code can't be debugged 
            //(or even browsed in dev-tools)
    
            for(i=0;i<10;i+=1) {
                document.getElementById('counter').innerText = i;
            }
    
            //but if I add the line below
            //it will "magically" show up in Dev Tools (or Firebug)
    
            //@ sourceURL=/path/to/my/ajaxed/page
        </script>
    <body>
    </html>
    

    Things I haven’t yet discovered:

    • Does this have to be done for every script block for inline scripts?
    • Does it have to be the last line of the script block? (The article would suggest the answer to this is yes)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was recently trying to re-install the fos:userbundle and noticed the docs have changed.
After just been coding for about 6-9 months. I probably changed my coding style
I have a coding style question which probably should be asked of a senior
I'm trying to improve my Javascript coding style and have been reading that it's
So, this is a question of coding style more or less. I'm using Bean
I have changed the DefaultMode property of my details view to Insert since I
I have changed my locale to English/Great Britain (en-GB) as described here . When
I have changed a lot of things in a java code but now I
In my database I have changed the type of a field from VARCHAR to
If an entities properties have changed in a controller action and Update/SaveChanges is not

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.