JavaScript

JavaScript

JavaScript DOM 概述

前段时间曾在《JavaScript 与JQuery 常用方法比较》一文中对JQuery和JavaScipt常用的方法做了简要的分析和介绍,但是还不够全面,今天将较为全面地介绍一下JavaScript对DOM操作,本文也只是简要分析,更详细的内容可以自行查阅相关DOM手册,希望对您学习JavaSCript有所帮助。

查找节点

获取Id

document.getElementById('IdName') 返回对拥有指定 id 的第一个对象的引用。

获取标签

document.getElementsByTagName('TagName') 返回带有指定标签名的对象集合。

获取Name对象

document.getElementsByName('Name') 返回带有指定名称的对象集合。

获取元素的属性值

调用google cdn的jquery.js 加快网站访问速度

Your rating: None Average: 7.9 (30 votes)

jquery现在是越来越大,网络加载速度上我们应该做到能省就省,毫无疑问google的服务器和cdn以及访问速度是非常快的,而且google敞开怀抱,提供各种代码库给我们下载调用。jquery就是其中一个。

Recruiting:Mobile Developer (iOS)

Your rating: None Average: 9 (1 vote)
WHB is a small getting bigger programming development studio specialized in creating digital tool for international custormers. We mainly focus on developing mobile applications on the iOS - Iphone/ Ipad and Android market. We also create corporate and client customized on line solutions for Intranet, E-commerce sites. The company is based in Shanghai and hires people all over China. Web:http://www.globalit-dev.com Email: Jazlyn.Sau@gmail.com

Recruiting:Mobile Developer (iOS)

WHB is a small getting bigger programming development studio specialized in creating digital tool for international custormers. We mainly focus on developing mobile applications on the iOS - Iphone/ Ipad and Android market. We also create corporate and client customized on line solutions for Intranet, E-commerce sites. The company is based in Shanghai and hires people all over China. Web:http://www.globalit-dev.com Email: Jazlyn.Sau@gmail.com

Recruiting:Mobile Developer (Android)

Your rating: None Average: 10 (1 vote)
WHB is a small getting bigger programming development studio specialized in creating digital tool for international custormers. We mainly focus on developing mobile applications on the iOS - Iphone/ Ipad and Android market. We also create corporate and client customized on line solutions for Intranet, E-commerce sites. The company is based in Shanghai and hires people all over China. Web:http://www.globalit-dev.com Email: Jazlyn.Sau@gmail.com

Recruiting:Mobile Developer (Android)

WHB is a small getting bigger programming development studio specialized in creating digital tool for international custormers. We mainly focus on developing mobile applications on the iOS - Iphone/ Ipad and Android market. We also create corporate and client customized on line solutions for Intranet, E-commerce sites. The company is based in Shanghai and hires people all over China. Web:http://www.globalit-dev.com Email: Jazlyn.Sau@gmail.com

Recruiting: Drupal Web Developer

Your rating: None Average: 10 (2 votes)
WHB is a small getting bigger programming development studio specialized in creating digital tool for international custormers. We mainly focus on developing mobile applications on the iOS - Iphone/ Ipad and Android market. We also create corporate and client customized on line solutions for Intranet, E-commerce sites. The company is based in Shanghai and hires people all over China. Web:http://www.globalit-dev.com Email: Jazlyn.Sau@gmail.com

JavaScript 与JQuery 常用方法比较

Your rating: None Average: 7.6 (14 votes)

1、加载DOM区别

JavaScript:

window.onload

function first(){
    alert('first');
}
function second(){
    alert('second');
}
window.onload = first;
window.onload = second;
//只会执行第二个window.onload;不过可以通过以下方法来进行改进:
window.onload = function(){
    first();
    second();
}

JQuery:

JavaScript入门笔记(2)

Your rating: None Average: 3 (3 votes)

4.break、continue分别与label语句联用分析:

1) break与label语句组合:

JavaScript入门笔记(1)

No votes yet

1.获取一个对象的长度用.length,后面不需要括号。如果想获取Dom对象的长度,需要将js在Dom加载完成后才能正确计算,否则返回的将是“0”,或者用window.onload方法。

举例:有一个无序列表,如下:

同步内容