易截截图软件、单文件、免安装、纯绿色、仅160KB

JavaScript就这么回事 (JS基础知识整理)

1 创建脚本块
 引用内容程序代码
<script language=”JavaScript”>
JavaScript 代码写在这里面
</script>
2 隐藏脚本代码
 引用内容程序代码
<script language=”JavaScript”>
<!--
document.write(“Hello”);
// -->
</script>
在不支持JavaScript的浏览器中将不执行相关代码
3 浏览器不支持的时候显示
 引用内容程序代码
<noscript>
Hello to the non-JavaScript browser.
</noscript>
4 链接外部脚本文件
 引用内容程序代码
<script language=”JavaScript” src="/”filename.js"”></script>
5 注释脚本
 引用内容程序代码
// This is a comment
document.write(“Hello”); // This is a comment
/*
All of this
is a comment
*/
6 输出到浏览器
 引用内容程序代码
document.write(“<strong>Hello</strong>”);
7 定义变量
 引用内容程序代码
var myVariable = “some value”;
8 字符串相加
 引用内容程序代码
var myString = “String1” + “String2”;
9 字符串搜索
 引用内容程序代码
<script language=”JavaScript”>
<!--
var myVariable = “Hello there”;
var therePlace = myVariable.search(“there”);
document.write(therePlace);
// -->
</script>
10 字符串替换
 引用内容程序代码
thisVar.replace(“Monday”,”Friday”);
11 格式化字串
 引用内容程序代码
<script language=”JavaScript”>
<!--
var myVariable = “Hello there”;
document.write(myVariable.big() + “<br>”);
document.write(myVariable.blink() + “<br>”);
document.write(myVariable.bold() + “<br>”);
document.write(myVariable.fixed() + “<br>”);
document.write(myVariable.fontcolor(“red”) + “<br>”);
document.write(myVariable.fontsize(“18pt”) + “<br>”);
document.write(myVariable.


相关文档:

2009 12 25传智播客——JavaScript:JQuery


 
使用过AJAX技术的人都知道大名鼎鼎的JQuery。虽然我来学习之前有看过AJAX的视频,但那时对WEB应用这个东西还比较模糊,不清楚HTML、JSP与Servlet是怎么工作的,甚至不知道JQuery包装的是什么东西。今日的学习再结合昨天的JavaScriptDOM的内容,让我对此十分清晰。JQuery原则:“write less, do more.” ......

JavaScript页面刷新与弹出窗口问题解决方法

JavaScript页面刷新与弹出窗口问题解决方法
 
1.无提示刷新网页
大家有没有发现,有些网页,刷新的时候,会弹出一个提示窗口,点“确定”才会刷新。
而有的页面不会提示,不弹出提示窗口,直接就刷新了.
如果页面没有form,则不会弹出提示窗口。如果页面有form表单,
a)< form method="post" ...&g ......

JavaScript Array 对象参考手册


Array 对象
Array 对象用于在单个的变量中存储多个值。
创建 Array 对象的语法:
new Array();
new Array(size);
new Array(element0, element0, ..., elementn);
参数
参数 size 是期望的数组元素个数。返回的数组,length 字段将被设为 size 的值。
参数 element ..., elementn 是参数列表。当使用这些参数来调 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号