I’m importing data from youtube into a textarea using Javascript.
If you I simply place my Javascript code onto a blank area it displays the information fine, but for some reason it doesn’t allow me to paste a same code into a textarea.
Here is my code:
<textarea rows="10" id="bandsvideodescription" name="bandsvideodescription">
<script type="text/javascript">
function youtubeFeedCallback( data )
{
document.writeln( '' + data.entry[ "media$group" ][ "media$description" ].$t.replace( /\n/g, '' ) + '' );
}
</script>
</textarea>
Any help would be great,
Thanks.
Textareas are defined as:
They can only contain PCDATA, which means no elements (including
<script>elements).Move the script to after the control, then get a reference to it (e.g. with
document.getElementById) and set itsvalueproperty instead of trying to write it out as the document loads.