调试html代码吗,html代码调试脚本

http://crossday.com)

Based upon: http://www.cnzzz.com

*******************************************************************************/

var sPop = null;

var postSubmited = false;

function ctlent(obj) {

if (navigator.userAgent.indexOf('MSIE') > 0) {

if (obj.keyCode == 9) {

obj.returnValue = false;

var sel = document.selection.createRange();

sel.text = '\t';

sel.select();

}

}

if(postSubmited == false && (obj.ctrlKey && obj.keyCode == 13) || (obj.altKey && obj.keyCode == 83)) {

var Input = document.getElementsByName('input')[0];

if(Input.pmsubmit) {

postSubmited = true;

Input.pmsubmit.disabled = true;

Input.submit();

} else if(validate(Input)) {

postSubmited = true;

if(Input.topicsubmit) Input.topicsubmit.disabled = true;

if(Input.replysubmit) Input.replysubmit.disabled = true;

if(Input.editsubmit) Input.editsubmit.disabled = true;

Input.submit();

}

}

}

function checkall(form, prefix) {

for(var i = 0; i < form.elements.length; i++) {

var e = form.elements[i];

if(e.name != 'chkall' && (!prefix || (prefix && e.name.match(prefix)))) {

e.checked = form.chkall.checked;

}

}

}

function findobj(n, d) {

var p,i,x; if(!d) d=document;

if((p=n.indexOf("?"))>0 && parent.frames.length) {

d=parent.frames[n.substring(p+1)].document;

n=n.substring(0,p);

}

if(!(x=d[n])&&d.all) x=d.all[n];

for(i=0;!x && i

for(i=0;!x && d.layers&&i>d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

return x;

}

function copyCode(obj) {

var rng = document.body.createTextRange();

rng.moveToElementText(obj);

rng.scrollIntoView();

rng.select();

rng.execCommand("Copy");

rng.collapse(false);

}

function runCode(obj) {

var winname = window.open('', "_blank", '');

winname.document.open('text/html', 'replace');

winname.document.writeln(obj.value);

winname.document.close();

}

function saveCode(obj) {

var winname = window.open('', '_blank', 'top=10000');

winname.document.open('text/html', 'replace');

winname.document.writeln(obj.value);

winname.document.execCommand('saveas','','code.htm');

winname.close();

}

function cleanBR() {

var area = document.getElementsByTagName('TEXTAREA');

for (var i=0; i

area[i].value = area[i].value.replace(/
/ig, '');

area[i].value = area[i].value.replace(/(\xA0\x20){4}/ig, '\t');

area[i].value = area[i].value.replace(/\xA0\x20\xA0/ig, ' ');

area[i].value = area[i].value.replace(/\xA0\xA0/ig, ' ');

}

}

function dzconfirm(theURL, ConfirmMsg) {

if (confirm( ConfirmMsg ))  {

window.location.href=theURL;

} else {

return;

}

}

window.onload = cleanBR;

提示:你可以先修改部分代码再运行

posted on 2006-03-28 23:30 汪杰 阅读(255) 评论(0)  编辑 收藏 引用

1e6267713b6379a9cf40ec69f9fae898.png

只有注册用户登录后才能发表评论。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值