js2

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			var arr = [‘a‘,‘b‘,‘c‘];
			var result = arr.join("+");
			alert(result);
			alert(arr.length);//var result = arr.join("+");这是一个拼接字符
			//直接在中间拼接的不改变原来的数组长度,只是对字符简单的拼接
			var acc = arr.reverse();
			alert(acc);//物理反转
		</script>
	</head>
	<body>
	</body>
</html>

  

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			var arr = "你好呀";
			alert(arr);
			var temp = encodeURI(arr);
			alert(temp);
			
			alert(decodeURI(temp));
		</script>
	</head>
	<body>
	</body>
</html>

  

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			var arr = [1,2,3,"a",true];
			var aaa = newArray();//默认长度是0
			/* for(int i = 0; i < 4 ;i++)
			{
				alert(arr[i]);
			} */
			alert(arr.length);
		</script>
	</head>
	<body>
	</body>
</html>

  

js2

上一篇:本地多图复制粘贴上传、剪贴板粘贴上传,返回base64


下一篇:CentOs7+Apache配置https站点