Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

@mariemosley mariemosley commented Aug 15, 2017

updated at line 29.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.