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 8147917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:31:00+00:00 2026-06-06T14:31:00+00:00

I * am using client-side JS to parse XML files and generate complex JS

  • 0

I* am using client-side JS to parse XML files and generate complex JS code to eval as a result. (Generating re-usable functions that are kicked off by a runtime.) However, I need to debug the code being generated, and would like to use Chrome’s built-in breakpoints, stepping, watch windows, etc.

Is there an easier way to do this than:

  • Dump the generated JS string to the console and/or window.
  • Copy the JavaScript
  • (optional) Run the JS through a prettifier like JSBeautifier.
  • Paste the JS into a file that is loaded via <script src="..."> in another web page.

* actually, a friend of mine was doing this, not me

  • 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-06T14:31:02+00:00Added an answer on June 6, 2026 at 2:31 pm

    Instead of using eval, and instead of manually copy/pasting into a separate file, you can dynamically load the JS directly into the page that generated it by using a data uri on a dynamically-created <script> element. With this approach, Chrome’s Developer Tools (and Firebug) allow you to pick the data-URI as a script, turn on the Pretty Print, set breakpoints, and away you go.

    var js = createMyJSCodeString();
    addCode(js); // Right now! Debuggable!
    
    // Dynamically evaluate JavaScript-as-string in the browser
    function addCode(js){
      var e = document.createElement('script');
      e.type = 'text/javascript';
      e.src  = 'data:text/javascript;charset=utf-8,'+escape(js);
      document.body.appendChild(e);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a unicode string that was encoded on the client side using JS
Can I parse LESS client side, and return the results? I am currently using
I have a client-side script written in jQuery that is sending text/xml data to
I am using the client side code from http://supportforums.blackberry.com/t5/BlackBerry-Push-Development/Simplified-BIS-Push-client-sample/ta-p/693857 on the BlackBerry Developer Support
When using client-side compilation for less, and if there are errors, Less is not
I'm using Client Side templates in my JavaScript. $create(Sys.UI.DataView, { data: data }, null,
I am using a client side validation and it is starting to get messy,
I have designed a webpage using HTML and client side validation using JavaScript.PHP for
I write my CSS with Lesscss using it on client side (with compiler less.js).
I need to model-bind data from textboxes generated dynamically on the client side (using

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.