要完成此效果把如下代碼加入到區(qū)域中
<script language=JavaScript>
\n<\/script>";
i++;
if (i=1) alert("代碼已編譯1次!");
else alert("代碼已編譯"+i+"次!");
}
function selectCode() /* Selecting "Compilation" for Copying */
{
if(document.pad.text.value.length>0)
{
document.pad.text.focus();
document.pad.text.select();
}
else alert('無任何內容被選中!')
}
function preview() /* Preview for the "Compilation" */
{
if(document.pad.text.value.length>0)
{
pr=window.open("","Preview","scrollbars=1,menubar=1,status=1,width=700,height=320,left=50,top=110");
pr.document.write(document.pad.text.value);
}
else alert('無任何內容可供預覽!')
}
function uncompile() /* Decompiling a "Compilation" */
{
if (document.pad.text.value.length>0)
{
source=unescape(document.pad.text.value);
document.pad.text.value=""+source+"";
}
else alert('請把需待還原的代碼copy到此框中!')
}
// -->
</script>