脚本菜鸟问题两则,望前辈回答 我也和你一样是个菜鸟,如果回答的不对还请各位原谅。你的问题1判断一下input中的字符是不是字母和特殊字符。有相关的资料你可以去查查。你的问题2好像javascript能够实现,但具体怎么实现我不知道了。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 问题1:document.forma.sUserName.value //文本框中的内容长度for (var i=0;i<document.forma.sUserName.value.length;i++) { var str=document.forma.sUserName.value; var intCode=str.charCodeAt(i); if (intCode>=0 && intCode<=128) {//continue; //字母 } else { //汉字 } } //end for2:document.referrer;history.back; 1.<script>function check(){ var reg=/[^\x00-\x80]/; var a=document.getElementById("txt").value; if(reg.test(a)) { alert("is 汉字"); } else { alert("no"); }}</script><input type=text id="txt"><input type="button" value="检查" onclick="check()">2.<a href="javascript:history.back(-1);">返回上一页</a> 1、<input name="aaa" onblur="if(/^[\u4e00-\u9fa5]+$/.test(this.value)){alert('全是汉字')}">2、返回用history.go(-1)或者history.back() 请问在FCKeditor中,下面代码的FCKeditor1是指什么对像? 加减法的问题 GoogleMap中缩放地图的游标如何实现? window.open打开flash,怎样获取flash的下载进度 请教,通过外部js文件方式写的元素如何去访问? 非常诡异的三段代码,哪位可以告诉我为什么会这样![附:网上演示] 在JS中可以再导入其他的JS文档不?? 请问如何获得数组的长度? 急死我了,高手帮忙 求助,500分求我内部要求的菜单原码! 同一页面内不同按钮显示不同数据 一个简单的递归函数不知错哪了,请高手指点
document.forma.sUserName.value //文本框中的内容长度for (var i=0;i<document.forma.sUserName.value.length;i++)
{
var str=document.forma.sUserName.value;
var intCode=str.charCodeAt(i); if (intCode>=0 && intCode<=128) {//continue;
//字母
}
else {
//汉字
}
} //end for2:
document.referrer;
history.back;
1.
<script>
function check()
{
var reg=/[^\x00-\x80]/;
var a=document.getElementById("txt").value;
if(reg.test(a))
{
alert("is 汉字");
}
else
{
alert("no");
}
}
</script>
<input type=text id="txt">
<input type="button" value="检查" onclick="check()">
2.
<a href="javascript:history.back(-1);">返回上一页</a>
2、返回用history.go(-1)或者history.back()