Open In App
Related Articles

Embedding an online compiler into a website

Improve Article
Save Article
Like Article

How to add a JDoodle compiler into a website?

Using the JDoodle compiler we can write our code in C, C++, Java, and in many more programming languages, and then we can embed and easily run that program in our webpage by giving standard inputs, and we can give command line arguments also.

Steps to follow:

Step 1: Open the website and sign in, if you don’t have an account then you must register first.

Step 2: Select any one programming language and write your code and save it. Click on editable share and copy the embed URL.

Step 3: On your website page insert the div and script tags as follows:

The below code will create a division and embed the compiler into a website page.      

<div data-pym-src="paste copied URL here."></div>

The below code will include the JavaScript code from the JDoodle. Include the below code at the bottom of the website page.

<script src=”” type=”text/javascript”></script>

Example: Following is an example of embedding a C++ compiler.


<!DOCTYPE html>
        Embedding an online compiler 
        into a website
    <!-- It will create a division for 
        compiler and embed that into 
        web page-->
    <div data-pym-src=
    <!-- This script tag contains the 
        javascript code in the written URL -->
    <script src=


Note: We can also hide the stdin inputs and command-line arguments by putting ?stdin=0&arg=0 at the end of the URL in the <div> tag. Here, stdin=0 is to hide stdin inputs and arg=0 to hide command line arguments. In order to enable it, just change ‘0’ by ‘1’.

Last Updated : 09 Dec, 2020
Like Article
Save Article
Similar Reads
Related Tutorials