Javascript on markdown file

I am new to web programming - HTML Javascript etc. Here I am testing how to use javascript on a markdown file for a github site. The code is as follows,

The code is taken from here


	<!-- Load plotly.js into the DOM -->
	<script src=''></script>

	<div id='myDiv'><!-- Plotly chart will be drawn inside this DIV --></div>

For Java script

    var trace1 = {
  x: [1, 2, 3, 4,5],
  y: [1,1,2,2,0],
  mode: 'lines', //use markers if you want just dots
  type: 'scatter'

var data = [trace1, trace2, trace3];

Plotly.newPlot('myDiv', data);

All in in one .md file in the _posts folder with correct naming. Results in the following figure.


subscribe via RSS