<script src="ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<div id="wrapper">
<div id="buttonWrapper">
<button id="submit">Click To Generate Phonetic Colors</button>
</div>
<div id="lyrics">
<div id="textArea">
<textarea id="foo">
So the FCC won't let me be
Or let me be me, so let me see
They try to shut me down on MTV
But it feels so empty without me
</textarea>
</div>
<div id="outputText">
<iframe name="MyFrame" id="MyFrame"></iframe>
</div>
<div/>
</div>
$('#submit').click(function(e) {
e.preventDefault();
// information to be sent to the server
var info = $('#foo').val().replace(/\[.*\]/i, '');
$.ajax({
type: "POST",
url: 'https://o6om5b3l21.execute-api.us-east-1.amazonaws.com/prod/colorLyrics',
data: info,
'contentType': 'text/plain',
datatype: "text/html",
success: function(msg) {
var doc = document.getElementById("MyFrame").contentWindow.document;
doc.open();
doc.write(msg);
doc.close();
}
});
});
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.