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

javascript入门基础知识

javascript入门基础知识
文章源于博客:http://www.cnblogs.com/seesky/articles/1433526.html
在网站制作的过程中经常需要用到JavaScript语句,掌握一些相关的JavaScript结构对网站制作有着重的重用!
1.document.write(""); 输出语句
2.JS中的注释为//
3.传统的HTML文档顺序是:document->html->(head,body)
4.一个浏览器窗口中的DOM顺序是:window->(navigator,screen,history,location,document)
5.得到表单中元素的名称和值:document.getElementById("表单中元素的ID号").name(或value)
6.一个小写转大写的JS: document.getElementById("output").value = document.getElementById("input").value.toUpperCase();
7.JS中的值类型:String,Number,Boolean,Null,Object,Function
8.JS中的字符型转换成数值型:parseInt(),parseFloat()
9.JS中的数字转换成字符型:(""+变量)
10.JS中的取字符串长度是:(length)
11.JS中的字符与字符相连接使用+号.
12.JS中的比较操作符有:==等于,!=不等于,>,>=,<.<=
13.JS中声明变量使用:var来进行声明
14.JS中的判断语句结构:if(condition){}else{}
15.JS中的循环结构:for([initial expression];[condition];[upadte expression]) {inside loop}
16.循环中止的命令是:break
17.JS中的函数定义:function functionName([parameter],...){statement[s]}
18.当文件中出现多个form表单时.可以用document.forms[0],document.forms[1]来代替.
19.窗口:打开窗口window.open(), 关闭一个窗口:window.close(), 窗口本身:self
20.状态栏的设置:window.status="字符";
21.弹出提示信息:window.alert("字符");
22.弹出确认框:window.confirm();
23.弹出输入提示框:window.prompt();
24.指定当前显示链接的位置:window.location.href="URL"
25.取出窗体中的所有表单的数量:document.forms.length
26.关闭文档的输出流:document.close();
27.字符串追加连接符:+=
28.创建一个文档元素:document.createElement(),document.createTextNode()
29.得到元素的方法:document.getElementById()
30.设置表单中所有文本型的成员的值为空:
var form = window.document.forms[0]
for (var i = 0; i<form.elements.length;i++){
     
if (form.elements[i].type == "text"){
         
form.elements[i].


相关文档:

JavaScript学习笔记(四)

1.出于安全考虑,JavaScript中只有开发者自定义的类可以被继承。
2.使用对象冒充实现继承
      function ClassA(sColor){
         this.color=sColor;
         this.showColor=function (){
 &nbs ......

[转帖]JavaScript窗体大小

[转帖]JavaScript窗体大小
网页可见区域宽:document.body.clientWidth
网页可见区域高:document.body.clientHeight
网页可见区域宽:document.body.offsetWidth (包括边线的宽)
网页可见区域高:document.body.offsetHeight (包括边线的宽)
网页正文全文宽:document.body.scrollWidth
网页正文全文高:docume ......

两个效果蛮好的javascript幻灯片(Jquery slider)

http://css-tricks.com/creating-a-slick-auto-playing-featured-content-slider/
demo:http://css-tricks.com/examples/FeaturedContentSlider/
Featured Content Slider Using jQuery
http://demo.webdeveloperplus.com/featured-content-slider/ ......

JavaScript实现页面传值

我还是菜鸟,请大家多指教!
页面一:
<html>
 <head>
  <title> 页面传值一 </title>
  <script>
    function funShow()
 {
    var arr=new Array(6);
       var arrs = showModalDialog("页 ......

javascript的history.go( 1)

javascript的history.go(-1)
echo '<script language="javascript">{alert("留言不能为空!");history.go(-1);}</script>';}
echo '<script language="javascript">{alert("留言不能为空!");return true;}</script>';}
这是不刷新页面的方式 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号