I want to have script reference code like this displayed in a textarea so the user can copy it.
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.1.min.js"/>
I’m using jquery and have tried using many solutions found on Stackoverflow or elsewhere but none of them works for me. Here is a snippet of my code:
var jqueryMin = $('<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.1.min.js"/>');
var readyHtml = $('<div>').append($(jqueryMin).clone()).html();
$('#headerHtml').text(readyHtml);
readyHtml is empty string though it works when I cloned other html code that is not a script block.
You have defined jqueryMin as an object- define it as a string.