发挥jQuery的威力

由于当前jQuery如此的如雷贯耳,相信不用介绍什么是jQuery了,公司代码中广泛应用了jQuery,但我在看一些小朋友的代码时发现一个问题,小朋友们使用的仅仅是jQuery的皮毛,只是使用id选择器与attr方法,还有几个动画,如果只是如此,相比于其带来的开销,其实还不如不使用,下面介绍几个jQuery常用的方法,来让jQuery的威力发挥出来,否则只用有限的几个方法,相对于运行速度问题,真不如不用jQuery。

jQuery如此之好用,和其在获取对象时使用与CSS选择器兼容的语法有很大关系,毕竟CSS选择器大家都很熟悉(关于CSS选择器可以看看十分钟搞定CSS选择器),但其强大在兼容了CSS3的选择器,甚至多出了很多。

选择器

有了CSS选择器基础后,看jQuery的选择器就很简单了,不再详细一一说明

基本选择器  
$(‘*’) 匹配页面所有元素
$(‘#id’) id选择器
$(‘.class’) 类选择器
$(‘element’) 标签选择器
   
组合/层次选择器  
$(‘E,F’) 多元素选择器,用”,分隔,同时匹配元素E或元素F
$(‘E F’) 后代选择器,用空格分隔,匹配E元素所有的后代(不只是子元素、子元素向下递归)元素F
$(E>F) 子元素选择器,用”>”分隔,匹配E元素的所有直接子元素
$(‘E+F’) 直接相邻选择器,匹配E元素之后相邻同级元素F
$(‘E~F’) 普通相邻选择器(弟弟选择器),匹配E元素之后同级元素F(无论直接相邻与否)
$(‘.class1.class2’) 匹配类名中既包含class1又包含class2的元素
基本过滤选择器  
$("E:first") 所有E中的第一个
$("E:last") 所有E中的最后一个
$("E:not(selector)") 按照selector过滤E
$("E:even")              所有E中index是偶数
$("E:odd")               所有E中index是奇数
$("E:eq(n)")            所有E中index为n的元素
$("E:gt(n)")            所有E中index大于n的元素
$("E:ll(n)")             所有E中index小于n的元素
$(":header") 选择h1~h7 元素
$("div:animated") 选择正在执行动画效果的元素
内容过滤器  
$(‘E:contains(value)’) 内容中包含value值的元素
$(‘E:empty’) 内容为空的元素
$(‘E:has(F)’) 子元素中有F的元素,$(‘div:has(a)’):包含a标签的div
$(‘E: parent’) 父元素是E的元素,$(‘td: parent’):父元素是td的元素
可视化选择器  
$(‘E:hidden’) 所有被隐藏的E
$(‘E:visible’) 所有可见的E
属性过滤选择器  
$(‘E[attr]’) 含有属性attr的E
$(‘E[attr=value]’) 属性attr=value的E
$(‘E[attr !=value]’) 属性attr!=value的E
$(‘E[attr ^=value]’) 属性attr以value开头的E
$(‘E[attr $=value]’) 属性attr以value结尾的E
$(‘E[attr *=value]’) 属性attr包含value的E
$(‘E[attr][attr *=value]’) 可以连用
子元素过滤器  
$(‘E:nth-child(n)’) E的第n个子节点
$(‘E:nth-child(3n+1)’) E的index符合3n+1表达式的子节点
$(‘E:nth-child(even)’) E的index为偶数的子节点
$(‘E:nth-child(odd)’) E的index为奇数的子节点
$(‘E:first-clild’) 所有E的第一个子节点
$(‘E:last-clild’) 所有E的最后一个子节点
$(‘E:only-clild’) 只有唯一子节点的E的子节点
表单元素选择器  
$(‘E:type’) 特定类型的input
$(‘:checked’) 被选中的checkbox或radio
$(‘option: selected’) 被选中的option

筛选方法

.find(selector) 查找集合每个元素的子节点

Get the descendants(子节点) of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.

$('li.item-ii').find('li').css('background-color', 'red');

.filter(selector) 过滤当前集合内元素

Reduce(减少) the set of matched elements to those that match the selector or pass the function's test.

$('li').filter(':even').css('background-color', 'red');

基本方法

.ready(handler) 文档加载完成后执行的方法,区别于window.onload

Specify a function to execute when the DOM is fully loaded.

$(document).ready(function() {
// Handler for .ready() called.
});

.each(function(index,element)) 遍历集合内每个元素

Iterate over a jQuery object, executing a function for each matched element.

$("li" ).each(function( index ) {
console.log( index + ": " + $(this).text() );
});

jQuery.extend( target [, object1 ] [, objectN ] ) 合并对象

Merge the contents of two or more objects together into the first object.

var object = $.extend({}, object1, object2);

获取元素

.eq(index) 按index获取jQuery对象集合中的某个特定jQuery对象

Reduce the set of matched elements to the one at the specified index.

.eq(-index) 按逆序index获取jQuery对象集合中的某个特定jQuery对象

  • An integer indicating the position of the element, counting backwards from the last element in the set.

$( "li" ).eq( 2 ).css( "background-color", "red" );

.get(index) 获取jQuery集合对象中某个特定index的DOM对象(将jQuery对象自动转换为DOM对象)

Retrieve one of the DOM elements matched by the jQuery object.

console.log( $( "li" ).get( -1 ) );

.get() 将jQuery集合对象转换为DOM集合对象并返回

Retrieve the DOM elements matched by the jQuery object.

console.log( $( "li" ).get() );

.index() / .index(selector)/ .index(element) 从给定集合中查找特定元素index

Search for a given element from among the matched elements.

1. 没参数返回第一个元素index

2.如果参数是DOM对象或者jQuery对象,则返回参数在集合中的index

3.如果参数是选择器,返回第一个匹配元素index,没有找到返回-1

var listItem = $( "#bar" );
alert( "Index: " + $( "li" ).index( listItem ) );

.clone([withDataAndEvents][,deepWithDataAndEvents]) 创建jQuery集合的一份deep copy(子元素也会被复制),默认不copy对象的shuju和绑定事件

Create a deep copy of the set of matched elements.

$( ".hello" ).clone().appendTo( ".goodbye" );

.parent([selector]) 获取jQuery对象符合selector的元素

Get the parent of each element in the current set of matched elements, optionally filtered by a selector.

$( "li.item-a" ).parent('ul').css( "background-color", "red" );

.parents([selector]) 获取jQuery对象符合选择器的祖先元素

Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector.

$( "span.selected" ) .parents( "div" ) .css( "border", "2px red solid" )

插入元素

.append(content[,content]) / .append(function(index,html)) 向对象尾部追加内容

Insert content, specified by the parameter, to the end of each element in the set of matched elements.

1. 可以一次添加多个内容,内容可以是DOM对象、HTML string、 jQuery对象

2. 如果参数是function,function可以返回DOM对象、HTML string、 jQuery对象,参数是集合中的元素位置与原来的html值

$( ".inner" ).append( "<p>Test</p>" );
$( "body" ).append( $newdiv1, [ newdiv2, existingdiv1 ] );
$( "p" ).append( "<strong>Hello</strong>" );
$( "p" ).append( $( "strong" ) );
$( "p" ).append( document.createTextNode( "Hello" ) );

.appendTo(target) 把对象插入到目标元素尾部,目标元素可以是selector, DOM对象, HTML string, 元素集合,jQuery对象;

Insert every element in the set of matched elements to the end of the target.

$( "h2" ).appendTo( $( ".container" ) );
$( "<p>Test</p>" ).appendTo( ".inner" );

.prepend(content[,content]) / .prepend(function(index,html)) 向对象头部追加内容,用法和append类似

Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.

$( ".inner" ).prepend( "<p>Test</p>" );

.prependTo(target) 把对象插入到目标元素头部,用法和prepend类似

Insert every element in the set of matched elements to the beginning of the target.

$( "<p>Test</p>" ).prependTo( ".inner" );

.before([content][,content]) / .before(function) 在对象前面(不是头部,而是外面,和对象并列同级)插入内容,参数和append类似

Insert content, specified by the parameter, before each element in the set of matched elements.

$( ".inner" ).before( "<p>Test</p>" );
$( ".container" ).before( $( "h2" ) );
$( "p" ).first().before( newdiv1, [ newdiv2, existingdiv1 ] );
$( "p" ).before( "<b>Hello</b>" );
$( "p" ).before( document.createTextNode( "Hello" ) );

.insertBefore(target) 把对象插入到target之前(同样不是头部,是同级)

Insert every element in the set of matched elements before the target.

$( "h2" ).insertBefore( $( ".container" ) );

.after([content][,content]) / .after(function(index)) 和before相反,在对象后面(不是尾部,而是外面,和对象并列同级)插入内容,参数和append类似

Insert content, specified by the parameter, after each element in the set of matched elements.

$( ".inner" ).after( "<p>Test</p>" );
$( "p" ).after( document.createTextNode( "Hello" ) );

.insertAfter(target) 和insertBefore相反,把对象插入到target之后(同样不是尾部,是同级)

Insert every element in the set of matched elements after the target.

$( "<p>Test</p>" ).insertAfter( ".inner" );
$( "p" ).insertAfter( "#foo" );

包裹元素

.wrap(wrappingElement) / .wrap(function(index)) 为每个对象包裹一层HTML结构,可以是selector, element, HTML string, jQuery object

Wrap an HTML structure around each element in the set of matched elements.

<div class="container">
<div class="inner">Hello</div>
<div class="inner">Goodbye</div>
</div>
$( ".inner" ).wrap( "<div class='new'></div>" );
<div class="container">
<div class="new">
<div class="inner">Hello</div>
</div>
<div class="new">
<div class="inner">Goodbye</div>
</div>
</div>

.wrapAll(wrappingElement) 把所有匹配对象包裹在同一个HTML结构中

Wrap an HTML structure around all elements in the set of matched elements.

<div class="container">
<div class="inner">Hello</div>
<div class="inner">Goodbye</div>
</div>
$( ".inner" ).wrapAll( "<div class='new' />");
<div class="container">
<div class="new">
<div class="inner">Hello</div>
<div class="inner">Goodbye</div>
</div>
</div>

.wrapInner(wrappingElement) / .wrapInner(function(index)) 包裹匹配元素内容,这个不好说,一看例子就懂

Wrap an HTML structure around the content of each element in the set of matched elements.

<div class="container">
<div class="inner">Hello</div>
<div class="inner">Goodbye</div>
</div>
$( ".inner" ).wrapInner( "<div class='new'></div>");
<div class="container">
<div class="inner">
<div class="new">Hello</div>
</div>
<div class="inner">
<div class="new">Goodbye</div>
</div>
</div>

.unwap() 把DOM元素的parent移除

Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.

pTags = $( "p" ).unwrap();

属性方法

.val() 获取元素的value值

Get the current value of the first element in the set of matched elements.

$( "input:checkbox:checked" ).val();

.val(value) /.val(function(index,value)) 为元素设置值,index和value同样是指在为集合中每个元素设置的时候该元素的index和原value值

Set the value of each element in the set of matched elements.

$( "input" ).val( ‘hello’ );
$( "input" ).on( "blur", function() {
$( this ).val(function( i, val ) {
return val.toUpperCase();
});
});

.attr(attributeName) 获取元素特定属性的值

Get the value of an attribute for the first element in the set of matched elements.

var title = $( "em" ).attr( "title" );

.attr(attributeName,value) / .attr(attributesJson) / .attr( attributeName, function(index, attr) ) 为元素属性赋值

Set one or more attributes for the set of matched elements.

$( "#greatphoto" ).attr( "alt", "Beijing Brush Seller" );

$( "#greatphoto" ).attr({
alt: "Beijing Brush Seller",
title: "photo by Kelly Clark"
}); $( "#greatphoto" ).attr( "title", function( i, val ) {
return val + " - photo by Kelly Clark";
});

.prop( propertyName ) 获取元素某特性值

Get the value of a property for the first element in the set of matched elements.

$( elem ).prop( "checked" )

.prop(propertyName,value) / .prop(propertiesJson) / .prop(propertyName,function(index,oldPropertyValue)) 为元素特性赋值

Set one or more properties for the set of matched elements.

$( "input" ).prop( "checked", true );

$( "input[type='checkbox']" ).prop( "checked", function( i, val ) {
return !val;
}); $( "input[type='checkbox']" ).prop({
disabled: true
});

关于attribute 和 property区别可以看看 jQuery的attr与prop

.data(key,value) / .value(json) 为HTML DOM元素添加数据,HTML5元素 已有data-*属性

Store arbitrary data associated with the matched elements.The .data() method allows us to attach data of any type to DOM elements in a way that is safe from circular references and therefore from memory leaks.

$( "body" ).data( "foo", 52 );
$( "body" ).data( "bar", { myType: "test", count: 40 } );
$( "body" ).data( { baz: [ 1, 2, 3 ] } );

.data(key) / .data() 获取获取data设置的数据或者HTML5 data-*属性中的数据

Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute.

alert( $( "body" ).data( "foo" ) );
alert( $( "body" ).data() ); alert( $( "body" ).data( "foo" ) ); // undefined
$( "body" ).data( "bar", "foobar" );
alert( $( "body" ).data( "bar" ) ); // foobar

CSS方法

.hasClass(calssName) 检查元素是否包含某个class,返回true/false

Determine whether any of the matched elements are assigned the given class.

$( "#mydiv" ).hasClass( "foo" )

.addClass(className) / .addClass(function(index,currentClass)) 为元素添加class,不是覆盖原class,是追加,也不会检查重复

Adds the specified class(es) to each of the set of matched elements.

$( "p" ).addClass( "myClass yourClass" );

$( "ul li" ).addClass(function( index ) {
return "item-" + index;
});

removeClass([className]) / ,removeClass(function(index,class)) 移除元素单个/多个/所有class

Remove a single class, multiple classes, or all classes from each element in the set of matched elements.

$( "p" ).removeClass( "myClass yourClass" );

$( "li:last" ).removeClass(function() {
return $( this ).prev().attr( "class" );
});

.toggleClass(className) /.toggleClass(className,switch) /  .toggleClass([switch]) / .toggleClass( function(index, class, switch) [, switch ] ) toggle是切换的意思,方法用于切换,switch是个bool类型值,这个看例子就明白

Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.

<div class="tumble">Some text.</div>

第一次执行

$( "div.tumble" ).toggleClass( "bounce" )
<div class="tumble bounce">Some text.</div>

第二次执行

$( "div.tumble" ).toggleClass( "bounce" )
<div class="tumble">Some text.</div>
$( "#foo" ).toggleClass( className, addOrRemove );

// 两种写法意思一样

if ( addOrRemove ) {
$( "#foo" ).addClass( className );
} else {
$( "#foo" ).removeClass( className );
}
$( "div.foo" ).toggleClass(function() {
if ( $( this ).parent().is( ".bar" ) ) {
return "happy";
} else {
return "sad";
}
});

.css(propertyName) / .css(propertyNames) 获取元素style特定property的值

Get the value of style properties for the first element in the set of matched elements.

var color = $( this ).css( "background-color" );

 var styleProps = $( this ).css([
"width", "height", "color", "background-color"
]);

.css(propertyName,value) / .css( propertyName, function(index, value) ) / .css( propertiesJson ) 设置元素style特定property的值

Set one or more CSS properties for the set of matched elements.

$( "div.example" ).css( "width", function( index ) {
return index * 50;
}); $( this ).css( "width", "+=200" ); $( this ).css( "background-color", "yellow" ); $( this ).css({
"background-color": "yellow",
"font-weight": "bolder"
});

事件方法

.bind( eventType [, eventData ], handler(eventObject) ) 绑定事件处理程序,这个经常用,不多解释

Attach a handler to an event for the elements.

$( "#foo" ).bind( "click", function() {
alert( "User clicked on 'foo.'" );
});

.delegate( selector, eventType, handler(eventObject) ) 这个看官方解释吧

Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements.

$( "table" ).on( "click", "td", function() {//这样把td的click事件处理程序绑在table上
$( this ).toggleClass( "chosen" );
});

.on( events [, selector ] [, data ], handler(eventObject) ) 1.7后推荐使用,取代bind、live、delegate

Attach an event handler function for one or more events to the selected elements.

$( "#dataTable tbody" ).on( "click", "tr", function() {
alert( $( this ).text() );
});

关于bind、live、delegate、on的区别可以看看 jQuery三种事件绑定方式.bind(),.live(),.delegate()

.trigger( eventType [, extraParameters ] ) JavaScript出发元素绑定事件

Execute all handlers and behaviors attached to the matched elements for the given event type.

$( "#foo" ).trigger( "click" );

.toggle( [duration ] [, complete ] ) / .toggle( options ) 隐藏或显示元素

Display or hide the matched elements.

$( ".target" ).toggle();
$( "#clickme" ).click(function() {
$( "#book" ).toggle( "slow", function() {
// Animation complete.
});
});

动画/Ajax

这两部分内容比较多,不是简单的一个function就可以的,这里只是列举一下常用方法名,关于其使用可以看看 jQuery API animation ajax ,或者 jQuery的动画处理总结ASP.NET 使用Ajax

动画

queue/dequeue/clearQueue

delay/stop

fadeIn/fadeOut/fadeTo/fadeToggle

slideUp/slideDown/slideToggle

show/hide

Ajax

$.ajax

$.load

$.get

最后

了解了上面这些内容,使用jQuery进行web开发的时候就可以体验到jQuery的威力了。本文不是jQuery学习指南,仅仅是个常用方法介绍,如果大家想学习jQuery,最好的教材还是jQuery API,本文中示例与英文解释全部来源于jQuery API。 另外文中介绍内容远远不是jQuery全部,但是首先掌握了这些可以对jQuery有一个比较全面的认识,然后再学习其他内容的时候就可以游刃有余了。

jquery 小插件,完成“输入字段预期值的提示信息”,防html5 placeholder属性

 

前言:在很多时候,我们需要文本框中显示默认值,获取焦点时,文字框中就会清空给的值,当失去焦点时,如果没有值,继续显示默认的文字,如果有输入值,就显示输入的值。现在项目中需要用到这个地方的功能比较多,于是想到了HTML5中的placeholder属性,但是总所周知,IE是咋们程序员心中的硬伤,不得不放弃。又不想在网上找这类似的,索性就自己写了一个,现在分享出来,供大家参考!

下面是插件的主要代码:

(function ($) {
$.fn.Placeholder = function (param) {
var defaults = {
defaultval: 'data-defaultval', // <input type="text" data-defaultval="文字说嘛" />
defaultClass: 'default_text_auto', // 样式名称
tipstext: '', // 默认提示文本,如果为空则或者defaultval的值,反之
focusClass: "block"
}
var $this = $(this); var options = $.extend(defaults, param);
var defaultval = options.tipstext == "" ? $this.attr(options.defaultval) : options.tipstext;
if (defaultval != "" && $this.val() == "") {
// 追加文字样式
$this.addClass(options.defaultClass);
// 赋值
$this.val(defaultval); // 添加焦点事件
$this.focus(function () {
if ($(this).val() == defaultval) {
$(this).val("");
// 移除样式
$this.removeClass(options.defaultClass);
$this.addClass(options.focusClass);
}
// 添加移开焦点事件
}).blur(function () {
if ($(this).val() == "" || $(this).val() == defaultval) {
// 赋值
$(this).val(defaultval);
// 追加文字样式
$this.addClass(options.defaultClass);
$this.removeClass(options.focusClass);
}
});
} else {
$this.addClass(options.focusClass);
}
}
})(jQuery);

这里是相关的的样式

.default_placeholder{color: #C8C8C8;}
.jp_focus {color:black;}

代码很简单,调用也很简单的:placeholder

/**
*
* 使用方法
* 最简单的调用方式
* $("#").Placeholder();
* $(".").Placeholder();
* $("input[type='值']").Placeholder();
*
*
*一般调用形式
* $("").Placeholder({
* placeholder: 'data-val',
* defaultClass: "class",
* tips: '测试文字'
* });
*/

这里是html代码:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script src="js/jquery-1.8.2.min.js"></script>
<link href="js/jquery.placeholder/jquery.placeholder.css" rel="stylesheet" />
<script src="js/jquery.placeholder/jquery.placeholder-1.0.0.js"></script>
<script type="text/javascript">
$(function () {
// 默认
$("#txt1").Placeholder(); // 自定义提示信息
$("#txt2").Placeholder({ tips: "随便输入点东西吧!" }); // 自定义data-placeholder
$("#txt3").Placeholder({ placeholder: "data-p" }); // 初始化了value
$("#txt4").Placeholder();
});
</script>
</head>
<body>
<input id="txt1" data-placeholder="请输入一个文本" type="text" />
<input id="txt2" type="text" />
<input id="txt3" data-p="自定义data-placeholder" type="text" />
<input id="txt4" data-placeholder="请输入一个文本" value="(初始化了value)" type="text" />
</body>
</html>

效果图,不会做gif图片抱歉,谁有好的软件,介绍一下,谢谢!!!

demo下载地址

 
 
 
分类: JavaScript

发挥jQuery的威力的更多相关文章

  1. 了解了这些才能开始发挥jQuery的威力

    由于当前jQuery如此的如雷贯耳,相信不用介绍什么是jQuery了,公司代码中广泛应用了jQuery,但我在看一些小朋友的代码时发现一个问题,小朋友们使用的仅仅是jQuery的皮毛,只是使用id选择 ...

  2. 了解了这些才能开始发挥jQuery的威力(转)

    链接:http://www.cnblogs.com/dolphinX/archive/2013/10/08/3347677.html 由于当前jQuery如此的如雷贯耳,相信不用介绍什么是jQuery ...

  3. (转)了解了这些才能开始发挥jQuery的威力

    原文地址:http://www.cnblogs.com/dolphinX/p/3347677.html 由于当前jQuery如此的如雷贯耳,相信不用介绍什么是jQuery了,公司代码中广泛应用了jQu ...

  4. jQuery的威力

    jQuery如此之好用,和其在获取对象时使用与CSS选择器兼容的语法有很大关系,毕竟CSS选择器大家都很熟悉(关于CSS选择器可以看看十分钟搞定CSS选择器),但其强大在兼容了CSS3的选择器,甚至多 ...

  5. 一个小时学会jQuery

    前一段时间录了一套关于jQuery的视频分享给大家,可以在下载区下载到,本来想配合文字一起的,后面发现视频+帮助文档也是非常好的学习方法. 一.jQuery简介与第一个jQuery程序 1.1.jQu ...

  6. 看了就很快学会jQuery

    一.jQuery简介与第一个jQuery程序 1.1.jQuery简介 1.2.jQuery特点 1.3.jQuery版本 1.4.获得jQuery库 1.5.第一个jQuery程序 二.jQuery ...

  7. jQuery学习总结(一)——jQuery基础与学习资源

    前一段时间录了一套关于jQuery的视频分享给大家,可以在下载区下载到,本来想配合文字一起的,后面发现视频+帮助文档也是非常好的学习方法. 一.jQuery简介与第一个jQuery程序 1.1.jQu ...

  8. JQuery实践--Why JQuery

    给页面增加动态功能的工作流模式:选择一个元素或一组元素,然后以某种方式对其进行操作. 利用原始的JavaScript完成这些任务中的任何一个,都会需要数十行代码,JQuery让这些常见的任务变得简单 ...

  9. 一个小时学会jQuery(转载)

    目录 一.jQuery简介与第一个jQuery程序 1.1.jQuery简介 1.2.jQuery特点 1.3.jQuery版本 1.4.获得jQuery库 1.5.第一个jQuery程序 二.jQu ...

随机推荐

  1. 【Leetcode】Sort List (Sorting)

    这个问题需要与归并排序排两个名单,基本思路分为切割与合并 合并后的代码Merge Two Sorted List里已经讲得非常清楚了. 所以这里直接给出代码. public ListNode merg ...

  2. 插件式Web框架

    转载构建高性能插件式Web框架 基于MVC插件模式构建支持数据库集群.数据实时同步.数据发布与订阅的Web框架系统.如下图: 1.基于插件式开发 采用插件模式开发的优点是使得系统框架和业务模式有效地进 ...

  3. DYNAMICRESOLUTION | NODYNAMICRESOLUTION

    有时候开启OGG进程的时候较慢,可能是由于须要同步的表太多,OGG在开启进程之前会将须要同步的表建立一个记录而且存入到磁盘中,这样就须要耗费大量的时间.OGG同一时候也提供了DYNAMICRESOLU ...

  4. [注意事项&amp;车轮]java源代码 产生局部javadoc api档

    随着Eclipse书写java码时间,有时候,因为我们不知道java函数返回.通过鼠标移动到java该功能,假设它javadoc相关内容将被显示. 但是,并非所有java代码javadoc:连装jav ...

  5. Oracle分区表转换

    Oracle普通表—>分区表转换(9亿数据量) 背景介绍: 环境:Linux 5.5 + Oracle 10.2.0.4 某普通表T,由于前期设计不当没有分区,如今几年来的数据量已达9亿+, 空 ...

  6. Ubuntu下的用户和权限(二)

    五.chown.chgrp命令 从名字就能够猜測他们是干嘛的,可是这两个命令须要root权限. chown命令的格式为:chown user:group file  中间的user : group三项 ...

  7. Java实现缓存(类似于Redis)

    Java实现缓存,类似于Redis的实现,可以缓存对象到内存中,提高访问效率.代码如下: import java.util.ArrayList; import java.util.HashMap; i ...

  8. sp.Net MVC4 + Oracle + EasyUI + Bootstrap2

    Asp.Net MVC4 + Oracle + EasyUI + Bootstrap 第二章   Asp.Net MVC4 + Oracle + EasyUI + Bootstrap 第二章 --使用 ...

  9. ResultSet取结果集多少条记录方法及分页概要

    allst=toconn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY); allsql = ...

  10. 接口自动化测试:参数化封装(excel文件读取)

    log4j.properties文件配置 log4j.rootLogger = DEBUG,stdout,F log4j.appender.stdout = org.apache.log4j.Cons ...