YourJS Console Documentation

Embedding a JavaScript console viewer on any website is really easy! You can embed YourJS Console with any preloaded code that you want. You can also just provide a blank console so that users can play around with JavaScript on their own.

The above code is all that you need to add a blank JavaScript console viewer (that is 200 pixels tall) to your website:

Initialize with Custom Code

Many times in your blog or on some other site you may want to have code that is run immediately. Doing this with YourJS Console is extremely easy. In the following markup you will see that we define the code that we want to run in the console using an anonymous function (it doesn't need to be anonymous though):

The above code produces the following YourJS Console viewer:

Apart from having JS code already specified, you may have noticed two differences in the above example:

  1. The height of the <div> containing the <iframe> is 300 pixels. (Default value is "500px")
  2. The border-radius of the <div> containing the <iframe> has been set 0 to get rid of the curved borders.