1、控制div的隐藏和显示:
    document.getElementById("typediv1").style.display="none";//隐藏 
    document.getElementById("typediv1").style.display="block";//显示 
2、js获得上一个页面的地址:
    document.referrer 
3、获得某个对象的值:

    document.getElementById("typediv1").value;

4、控制只输入数字:

<input type="text" class="list_page_text" id="jumpPage"  maxlength="3" οnkeyup="javascript:this.value=this.value.replace(/[^\d]/g,'')"/>

5、js 大小写转换

stringVar.tolocaleUpperCase( );

stringVar.toLowerCase( );

6、数字类型转换

parseInt():转换成整数;parseFloat():转换成浮点数;

var num = $("#num").val();

num = parseInt(num);//把num转换成×××数

7、禁用后退按钮

window.location.replace=url地址;但是这个方法火狐不兼容

javascript: window.history.forward(1);兼容性不错,效果可能不太理想

8、js跳到另一个页面:

window.location.href =URL;

9、js提交表单

$("#form1").submit();

10、checkbox全选

 $(".check_all").click(function(){
        if($(".check_all").attr("checked") == "checked"){
            $(":checkbox").attr("checked",true);
        }
        if($(".check_all").attr("checked") == undefined){
            $(":checkbox").attr("checked",false);
        }
    });


function checkAll() {
    if ($('#chk_all').is(':checked')) {
        $("input[name='checkName']").each(function () {
            $(this).attr("checked", true);
        });
    } else {
        $("input[name='checkName']").each(function () {
            $(this).attr("checked", false);
        });
    }
}

11、判断checkbox是否被选中

if ($('#chk_all').is(':checked')) {//判断checkbox是否被选中

}

12、获得页面上选中的checkbox

var ids="";

var array = $("input[name='checkName']");
    if (array=="" || array==undefined) {
        alert("请选择需要确认的订单!");
        return false;
    }
    var ids = "";
    for (var i = 0; i < array.length; i++) {
        if (array[i].checked) {
            ids = ids + array[i].id + ",";
        }
    }
    ids = ids.substring(0, ids.length - 1);

显示获得所有的checkbox,然后循环遍历。

13、Jquery ajax请求:

   $.ajax({ //一个Ajax过程
        type: "post", //以post方式与后台沟通
        url: "/HNAccountOrder/sureOrder", //与此php页面沟通
        dataType: 'text',//从php返回的值以 JSON方式 解释
        data: { "ids": ids }, //发给php的数据有两项,分别是上面传来的u和p
        success: function (json) {//如果调用php成功
            if (json == "True") {
                alert("确认成功!");
                return false;
            } else {
                alert("确认失败!");
                return false;
            }
        }
    });
}

另外给大家推荐个网站,感觉挺不错!

http://www.codeforge.cn/point/?recoid=1504886