Global对象
全局对象,Global封装的方法可以直接调用,方法名(); gbk 一个汉字2字节 一个字节8个二进制位 utf-8 一个汉字3个字节
<!DOCTYPE html>
<html lang="en">
<head>
<meta charsset="UTF-8">
<title>Array对象</title>
<script>
var str = "天天向上,好好学习"
var encode = encodeURI(str);
document.write(encode +"<br>");
var s = decodeURI(encode);
document.write(s +"<br>");
var str = "天天向上,好好学习"
var encode = encodeURIComponent(str);
document.write(encode +"<br>");
var s = decodeURIComponent(encode);
document.write(s +"<br>");
var str = "123abc";
var number = parseInt(str);
alert(number);
var str = "a123abc";
var number = parseInt(str);
alert(number);
var a = NaN;
document.write(a==NaN);
document.write(isNaN(a));
var jscode="alert(123)";
eval(jscode);
</script>
</head>
</html>
|