+ 16
How to make our own js consoleš?? Can we??
3 Answers
+ 10
it's simple.š
just use the <iframe> with a srcdoc ...like this
<iframe srcdoc= " ">
</iframe>
then create an input where we can assign the value of the input to the srcdoc
then after that..to catch the errors.... to make your code look like a js console..you can add
try {
// expression that may be incorrect;
}
catch(error)
{ console.error( ifame.message ) }:
then the js console is compelete....look at this code though I am not true with it..go to the code playground section
https://code.sololearn.com/W8G4HBWB64ax/?ref=app
+ 4
for simplicity see this example...
https://code.sololearn.com/W0qUaQCLM47l/?ref=app
+ 2
Do you mean something like;
https://code.sololearn.com/WCo44FR4eubp/?ref=app