web_js

来源:互联网 发布:淘宝客服用语大全 编辑:程序博客网 时间:2024/06/05 19:47
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <html><head><script language="javascript">function test(){window.alert("hello world!");}</script></head>乱码问题:charset=utf-8问题:·          js的位置可以随意放·          js必须使用   <scriptlanguage="javascript">  代码</script>·          在一个html文件中(JSP/PHP/ASP.NET)可以出现多对(script)片段,浏览器会按照先后顺序一次执行<title>Test Hello</title><body><input type="button" onClick="test()" value="点击一下吧"/></body></html>
<p>·          <strong>Js的命名规范(函数/变量):</strong></p><p><strong>1)    使用大小写字母,数字,$可以命名</strong></p><p><strong>2)    不能以数字打头</strong></p><p><strong>3)    不能使用js保留字和关键字(即java里的关键字)</strong></p><p><strong>4)    区分大小写</strong></p><p><strong>5)    单行注释://</strong></p><p><strong>6)    多行注释:/*…….*/</strong></p>
                                             
0 0