Fiddler debugging the Line JS code

Source: Internet
Author: User

Strongly recommend a JS debugging artifact, Fiddler


Everyone usually used the Firefox firebug or Google Debugging tools to debug JS, but unfortunately we can not like editing html,css to directly add or delete JS code.

  

While the JS code can be executed dynamically through the console of the Debug tool, it is sometimes far from enough.

   

In particular, when the production line environment can not be arbitrarily modified files, using the online environment to debug the local code is an urgent need.

  

(often local test pass, on-line is a variety of bugs.)

   

Share today how to use Fiddler to modify and debug the JS code on the line.

   

To the blog home For example, with my local JS file to replace one of its JS.

    

View Home source code found a JS, take it to open the brush.



1, Open fiddler, capture the blog Park home page request. Find the "aggsite.js" request.




2, There is a technique, you can use the "select" command to filter the JS request. Enter "Select Script" in the Command box below .




3, Then drag the request to the Autoresponder panel.

Before dragging, remember to check the "Enable Automatic Responses" and "Permit Passthrough for unmatched requests" first.




4 . Then select "Find a file" in the second drop-down box in the rule editor to select the local JS files and select Save later.

Here I use the local "test Fiddler.js" to replace the "Aggsite.js" on the home page of the blog.

The "Test Fiddler.js" content is as follows. is to append a paragraph of red text to the body.

$ (function () {    var p=$ ("<p/>"). Text ("This is fiddler plus JS"). CSS ("text-align", "center"). CSS ("Color", "red");    $ ("Body"). Prepend (P);    });

Well, refresh the blog Park homepage to see the effect.


As you can see, our replacement JS is executed, then we can write the JS code locally using our handy editor.

After the local save, refresh the page to see the effect immediately, as in the local development, is not very convenient?

Finally, you can replace the picture in the same way, css,html.

The point is to use the online environment to test your code, but not to have an impact on the line.

To know how important it is to ensure that onlinebug bugs are not guaranteed, although it is difficult to do so, try to avoid them.


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Fiddler debugging the Line JS code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.