English 中文(简体)
无需安排我的json产出
原标题:Need to format my json output a little better
  • 时间:2011-06-10 01:01:20
  •  标签:
  • json
  • console

I m trying to make a nice representation of the console.log onto the page itself. I have the following:

window.PRINT = function() {
   if(this.console) { 
      console.log( Array.prototype.slice.call(arguments) );
   }

   var X = $( #PRINT );
   if (!X) {
      $( body ).append( <p id="PRINT"></p> );
      X = $( #PRINT );
   }
   $.each(arguments, function(Index,  Value) {
      X.append( <p>  + JSON.stringify(Value) +  </p> );
   });
};

问题在于我何时使用它。

$( input ).change(function(myEvent) { 
   PRINT(myEvent,this); 
});

It doesn t really do a very good job of printing out the objects and their contents. I wonder if there s a json formatter somewhere. I m not talking about a Firefox plugin, I mean: one that accepts json coming in and outputs a nice html representation of it, perhaps.

最佳回答
问题回答

如果你只是想像JSON那样使用某种东西。

http://udioizer.json2html.com” rel=“nofollow”





相关问题
Caching System.Console output

We have some methods that output a lot of coloured text to the Console. It s actually a menu that is built by looping through a collection of data. Because we are writing item by item (and one line ...

console app c++

i m new to console apps and would appreciate some pointers... i have created a new console app and (not finished but it should be working), i selected win32 console app and then selected empty ...

Java prints output twice in a very specific circumstance

System.out.print("My string: "); My string: BUILD SUCCESSFUL (total time: 1 second) System.out.print("My string "); My string BUILD SUCCESSFUL (total time: 1 second) System.out.print("My string: ...

Removing pause after reading using readLine in java

I am reading several lines from the console in a java program using the readLine command from the BufferedReader class. However, the program pauses at the end of the last line and does not proceed ...

热门标签