Wednesday, 6 July 2016

Run programs directly from your Blog or Website

How nice it would be if the programs in your website/blog is directly executable without copying to an editor. Yes now it is possible with JDoodle.com.

JDoodle is an online compiler and editor for Java, C, C++ and many more languages, now using JDoodle you can make the programs in your website executable for around 25 languages supported by JDoodle. Below is a sample program which you can execute from this blog itself.




Below is an another Java Program where you can pass Input Parameters to the program



Below is an another Java Program where you can pass Standard Input (STDIN) inputs to the program



Including executable programs into your website/blog is easy


  • Goto JDoodle.com
  • Sign-in, if you don't have an account create one, it just takes a minute.
  • select the language in which you want to write program
  • create a program
  • save the program
  • click on Others --> Share/Embed
  • copy embed url 
  • Goto your website insert the copied url in a div as follows
    • <div data-pym-src="https://www.jdoodle.com/embed/v0/java/jdk-1.8/1?stdin=0&arg=0"></div>
  • include the below at bottom  of the Blog Post or Website
    • <script src="https://www.jdoodle.com/assets/jdoodle-pym.min.js" type="text/javascript"></script>

By Default embed url will display the stdin (for all languages) and arguments (java only) input boxes, they can be disabled by passing following parameters

stdin=0 (hide stdin box), arg=0 (hide argument box), changing from 0 to 1 will display the boxes.

Alternatively you can access your shared programs in 3 different plain format (xml, json, text) by just adding format parameter at the end of your shared url. Below are some examples


Please contact JDoodle and inform if you are embedding code in your site, so that they can update regarding embed functionality in advance if any.