2

I don't want again and again change JSON file to debug with different data.

Can I use chrome tool to update data?

I was searching the options in developer tool, but no luck.

shaik
  • 275
  • 2
  • 6
  • 11
  • A little more info would be useful. Where is the JSON file (on a server?)? How do you currently change it and how would you like to do it instead? If for example you currently edit the JSON in a text editor over ssh I cannot see how using chrome would be an improvement. – tobib Apr 22 '14 at 07:54
  • yeah, there is too little information – wong2 Apr 22 '14 at 07:56
  • Json is a restful service. Assume that we implemented a logic for `true` and `false` values. We can test our logic with value `true` as json gives this value every time. Now we need value `false` to make sure our logic works fine with both values. Here we need to replace `true` with `false` in run time using chrome dev tool. – shaik Apr 23 '14 at 10:23

1 Answers1

0

I'm making some assumptions here, but I'm assuming the JSON you're dealing with ends up on the client-side as a script.

If this is so, you can edit the JSON (temporarily for that tab session) through Chrome's dev tools. Simply open the dev tools panel and select the "Sources" tab: The Sources panel

Here you can select the "Sources" sub-tab to view all of the scripts that were loaded for that page. If you can find the JSON file you're working with, you can open it and edit it in the right pane.

Be advised that changes made will only take affect if the current page passes over that object again - reloading the page will wipe your changes here.

This question has been addressed (if only partially) here: Editing in the Chrome debugger

Community
  • 1
  • 1
Perry
  • 26
  • 3