文章分类 - javascript笔试面试题
摘要:例子:$(document).ready(function() { $("#orderedlist li:last").hover(function() { $(this).addClass("green"); },function(){ $(this).removeClass("green"); # $(this) }); });$(document).ready(function() { // use this to reset several forms at once $("#reset").click(f
阅读全文
摘要:javascript部分//先判断是否是ie6if(/msie|MSIE 6/.test(navigator.userAgent)){ // search for selectors you want to add hover behavior to $('.jshover').hover( function(){ $(this).addClass('over'); }, function(){ $(this).removeClass('over'); }}或者: Special instructions for IE 6 here... e.g
阅读全文
摘要:背景在搜索引擎中搜索关键字.htaccess 缓存,你可以搜索到很多关于设置网站文件缓存的教程,通过设置可以将css、js等不太经常更新的文件缓存在浏览器端,这样访客每次访问你的网站的时候,浏览器就可以从浏览器的缓存中获取css、js等,而不必从你的服务器读取,这样在一定程度上加快了网站的打开速度,又可以节约一下你的服务器流量。问题现在问题来了,.htaccess设置的css、js缓存都有一个过期时间,如果在访客的浏览器中已经缓存了css、js,在这些css、js缓存未过期之前,浏览器只会从缓存中读取css和js,如果你在服务器上修改了css和js,那么这些更改在回头客的浏览器中是不会有变化的
阅读全文
摘要:1.var foo = "Hello"; (function() { var bar = " World"; alert(foo + bar); // 返回Hello World})();alert(foo + bar); //bar is not defined内部函数,外部无法访问,也就是所谓的闭包。2.继承使用call()或者apply();①call方法: 语法:call([thisObj[,arg1[, arg2[, [,.argN]]]]]) 定义:调用一个对象的一个方法,以另一个对象替换当前对象。 说明: call 方法可以用来代替另一个对
阅读全文