<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" > |
<html> |
<head> |
<title>JS中的全局对象</title> |
|
</head> |
|
<body> |
<script type= "text/javascript" > |
var s = "你好abc" ; |
var es = encodeURI(s); |
//url编码 |
document.write(s.fontcolor( 'red' )+ "编码后的值:" +es + "<br/>" ); |
var ds = decodeURI(es); |
document.write(es.fontcolor( 'red' )+ "解码后的值:" +ds + "<br/>" ); |
document.write(parseInt( "3c" , 16)+ "<br/>" ); |
document.write( "alert('你好')" + "<br/>" ); |
document.write( eval( "alert('你好')" )); |
alert( '你好' ); |
|
</script> |
</body> |
</html> |