用过JavaScript的童鞋,应该知道window对象和document对象,也应该听说过load事件和ready事件,小菜当然也知道,而且自认为很了解,直到最近出了问题,才知道事情并不是那么简单。 首先说说window和document,直观上来讲,window代表的是浏览器窗口,而do...
1.文档加载后执行:$(document).ready(function(){//onload();});或$(function(){//onload();})2. 选择器使用:$("table a",context);得到context为上下文的table里面所有的连接元素。3. ajax操作:$...
分类:
Web程序 时间:
2014-08-27 21:45:28
阅读次数:
190
第一集.页面加载完成后执行 js 代码:$(document).ready(function(){ $("h1").text("Where to?");});第二集.查找网页元素的方式:$("h1") 使用标签获取网页元素$("#ID") 使用标签ID获取网页元素$(".ClassName") 使....
分类:
Web程序 时间:
2014-08-27 20:07:28
阅读次数:
252
1、$(document).ready()方法和window.onload方法区别
为了正常操作页面元素,我们需要把操作元素的JS代码写在$(document).ready()(Jquery)或window.onload(普通JS)中。$(document).ready()(这种写法实际上是/把dom对象document转换成了jQuery对象,然后注册ready()事件)一般我们可以简化为
...
分类:
Web程序 时间:
2014-08-27 18:52:28
阅读次数:
471
我们常做的,页面加载完毕 我们要做一些事情常用到的有以下几种方式。1. jQuery.readyjQuery 基本每一个搞前端的童鞋都会使用了 , 这个确实给我们带来极多的便利。 jQuery ready 触发是在DOM加载完毕即触发。比window.onload优先。附图:jQuery版本大小 (...
分类:
编程语言 时间:
2014-08-25 13:11:54
阅读次数:
286
5 life lessons you will learn the hard way五条垂暮之年才明白的道理Life is not easy when you are pursuing something worthwhile and ready to learn from the best exp...
分类:
其他好文 时间:
2014-08-25 11:31:04
阅读次数:
275
[Po and Shifu are racing each other up the palace stairs.]SHIFU:Are you ready?PO:Ready's my middle name![Po speeds off ahead, and beats Shifu to their...
分类:
其他好文 时间:
2014-08-25 09:52:14
阅读次数:
354
可见性:
我们希望确保一个线程修改了对象的状态后,其他线程能够看到发生的状态变化。
例:在没有同步的情况下共享变量
public class NoVisibility {
private static boolean ready;
private static int number;
public static class Rea...
分类:
编程语言 时间:
2014-08-24 15:31:02
阅读次数:
190
1 public class NoVisibility{ 2 private static boolean ready; 3 private static int number; 4 private static class ReaderThread extends Thread...
分类:
编程语言 时间:
2014-08-23 11:06:50
阅读次数:
302