Embedding an online compiler into a website
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 JDoodle.com 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>
Example: Following is an example of embedding a C++ compiler.
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’.
Please Login to comment...