Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mariemosley
Forked from junyper/codepen_button.html
Last active August 15, 2017 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mariemosley/480128d3fd312a0f4455c6b736b56c71 to your computer and use it in GitHub Desktop.
Save mariemosley/480128d3fd312a0f4455c6b736b56c71 to your computer and use it in GitHub Desktop.
codepen button
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<form
action="https://codepen.io/pen/define"
method="POST"
target="_blank"
>
<input id="data" type="hidden" name="data" />
<button type="submit">codepen</button>
</form>
<script>
const data = {
title: 'Button',
private: true,
js: 'console.log(React)',
private: true,
editors: '001',
html: '<div id="app"></div>',
layout: 'top',
js_pre_processor: 'babel',
js_external: 'https://cdnjs.cloudflare.com/ajax/libs/react/15.6.1/react.min.js;https://cdnjs.cloudflare.com/ajax/libs/react/15.6.1/react-dom.min.js'
}
const jsonString = JSON.stringify(data).replace(/"/g, '&quot;').replace(/'/g, '&apos;')
$('#data').val(jsonString)
</script>
</body>
</html>
@mariemosley
Copy link
Author

updated at line 29.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment