欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

js網(wǎng)頁中的(運(yùn)行代碼)功能實(shí)現(xiàn)思路

 更新時(shí)間:2013年02月04日 09:15:30   作者:  
網(wǎng)頁中的"運(yùn)行代碼"是一個(gè)很方便的功能,可以直接看到代碼的效果,感興趣的朋友不妨參考下,或許對(duì)你學(xué)習(xí)js有所幫助,好了花不多說切入正題
復(fù)制代碼 代碼如下:

<!DOCTYPE html>
<html>
<head>
<meta charset='utf8' />
<title>網(wǎng)頁中的運(yùn)行代碼功能</title>
<script type="text/javascript">
function runCode(oCode) {
var win = window.open('', "_blank", '');
win.document.open('text/html', 'replace');
win.opener = null
win.document.write(oCode.value);
win.document.close();
}
</script>
</head>
<body>
<textarea id="code1" rows="10" cols="95">
<!DOCTYPE html>
<html>
<head>
<meta charset='utf8' />
<title>測(cè)試文檔</title>
</head>
<body>
測(cè)試文檔 - 你可以先修改部分代碼再運(yùn)行
<script>alert('hello')</script>
</body>
</html>
</textarea>
<br>
<input type="button" value="運(yùn)行代碼" onclick="runCode(code1)">
</body>
</html>

相關(guān)文章

最新評(píng)論