3

I basically want to do what jsbin.com does. Here is their code. That is having a mostly functional console inside my React application. I managed to hijack the console in such a way that i change the return value of each call via this guide. But how could i for example show error messages i get in the console in browser?

Is there a way to intercept console method return values and save them to variables?

I would also love to be able to declare variables via my inbrowser console. What would i have to do to make this possible? Can i send input strings to be evaluated by the console?

Edit:

i found a really great plugin called jq-console which will handle my input and output, BUT how do i handle the input and output? If i for example want to declare a var test = 5;, how would i do this and then return the corresponding console answer?

Divide by Zero
  • 1,343
  • 1
  • 14
  • 37
  • 1
    https://stackoverflow.com/questions/20256760/javascript-console-log-to-html/20256785 This should help you a lot – Abana Clara Aug 22 '18 at 06:39
  • 1
    That is a good example thanks. But it still does not give me the return value of the log, does it? e.g. "ReferenceError: x is not defined" – Divide by Zero Aug 22 '18 at 07:29

0 Answers0