JavaScript过滤符号,并对非中文全角转半角
//过滤所有的非中文,字母,数字字符
function filter_str(str)
{
interval=typeof(arguments[1])!='undefined'?arguments[1]:' ';
if(str.length>0)str=DBC2SBC(str)
return str.replace(/[^\u4E00-\u9FA5a-zA-Z0-9]/g,interval)
}
//* 参数说明:
//* str:要转换的字符串
//* flag:标记,为0时半转全,为非0时全转半 默认是1
//* 返回值类型:字符串
function DBC2SBC(str) {
var i;
var result='';
flag=typeof(arguments[1])!='undefined'?arguments[1]:1;
if (str.length
相关文档:
方案一:
// html & JavaScript
...
<button value="Click me"
onclick="window.navigate('app:command&arg1=1&arg2=2')" />
...
// C++: 响应 的消息函数OnBeforeNavigat2
virtual void OnBeforeNavigate2( LPCTSTR lpszURL, DWORD nFlags, LPCTSTR lpszTar ......
html:
<html>
<head>
<title>calendaragain</title>
<link rel=stylesheet href="calendaragain.css">
<script type = " ......
<html>
<head>
<mce:script type="text/javascript"><!--
function aaa()
{
alert("oh no");
window.location="http://community.csdn.net/";
}
// --></mce:script>
</head>
<body onload = aaa();>
< ......
selected控件:在js中的设置是默认是 selected=true
button和checkbox的可用性设置: disabled=true
text文件的只读属性:readOnly
在存在Iframe的时候在需要控制外部数据的时候需要用到 parent
对象没有length属性,只有数组有length长度
在js中可以对对象随意赋属性,如果该属性没有值则为undefined
sortArra ......