ITeye博客

jQuery

共 39 篇文章

JQuery Uploadify 基于JSP的无刷新上传实例:

1、JQuery Uploadify 基于JSP的无刷新上传实例: http://blog.csdn.net/wangqiuyun/article/details/9197021 Ie9下面的那个问题可以通过把flash的路径写一个完整的路径 比如 http://www.baidu.com/uploadify.swf 这样来引用 不要通过本地路径来引用 就可以解决 2、另一个人的结合struts2上传 这个是我用struts2结合commons-FileUpload插件实现的多文件上传: http://blog.csdn.net/llhhyy1989/article/details/7395…

2013-12-26 11:53 · Ajax · jQuery · struts2

jquery 的 万年历

jquery 的 万年历

2013-12-17 12:11 · jQuery

jquery 解决多次提交

来源: http://andrewye.iteye.com/blog/552324 web应用中常见的问题就是多次提交,由于表单提交的延迟,有时几秒或者更长,让用户有机会多次点击提交按钮,从而导致服务器端代码的种种麻烦。 为了解决这个问题,我们可以绑定处理程序到表单的提交事件上,在提交按钮第一次点击之后禁止提交按钮。 Js代码 $("form").submit(function(){ $(":submit",this).attr("disabled","disabled"); }); 在事件处理程序体内,用:submit选择器来获取表单内所有的提交按钮,并将disable特性值改为disab…

2013-12-13 11:10 · jQuery

jQuery 弹出 div层

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <style type="text/css"> #BgDivOutDivId{background-color:#e3e3e3; position:absolute; z-index:99; left:0; top:0; display:none; width:100%; height:1000px;opacity:0.5;filter: alpha(opaci…

2013-11-22 18:58 · javaScript · jQuery

jquery 1.9版本下复选框 全选 及 取值操作

<!DOCTYPE Html> <html> <head> <script type="text/javascript" src="c:/jquery.js"></script> <script type="text/javascript"> function selectAll(checkbox) { //1、 1.9以前的方法 // $('input[type=checkbox]').prop('checked', $(checkbox).prop('checked')); //2.以下代码,官方代码 $("input[name='chk_list']").prop("checked",…

2013-11-14 23:33 · jQuery

匹配数字或包含最多两位小数的数字

1、匹配数字 <input onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"> 2、匹配数字或包含最多两位小数的数字 <input onkeyup="if(this.value==this.value2);if(this.value.search(/^\d*(?:\.\d{0,2})?$/)==-1)this.value=(this.value2)?this.val…

2013-11-05 16:24 · javaScript · jQuery

Ajax 怎么解决跨域问题????

1、Ajax 怎么解决跨域问题????

2013-09-12 21:38 · Ajax · jQuery · 期待解决的问题

jquery Validation 的应用

jquery Validation 的应用 在附件中,下载运行即可!

2013-07-16 16:04 · jQuery

jquery 下拉框 的值 转移

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <style type="text/css"> * { margin:0; pa…

2013-07-08 15:28 · jQuery

jquery after append appendTo三个函数的区别

jq文档的说明是 1、after函数 定义和用法: after() 方法在被选元素后插入指定的内容。 语法: $(selector).after(content) 实例: <html> <head> <script type="text/javascript" src="/jquery/jquery.js"></script> <script type="text/javascript"> $().ready(function(){ $("button").click(function(){ $("span").after("<a href="#">ddddd</a>") }) }) </s…

2013-07-08 14:51 · jQuery

jQuery学习之prop和attr的区别

.prop() 1、.prop( propertyName ) 获取匹配集合中第一个元素的Property的值 2、 .prop( propertyName, value ) .prop( map ) .prop( propertyName, function(index, oldPropertyValue) ) 给匹配元素集合设定一个或多个属性 .prop()和 .attr()区别 下面是关于jQuery1.6和1.6.1中Attributes模块变化的描述,以及.attr()方法和.prop()方法的首选使用 Attributes模块的变化是移除了attributes和propertie…

2013-07-05 16:34 · javaScript · jQuery

jquery 实现 邮箱的 全选/全不选 全选与全不选功能

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title> New Document </title> <script src="c:\jquery.js""></script> </head> <script> // 全选/全不选 $(function(){ // alert(true&&false); $("#checkboxAll").click(function(){ $("[name=items…

2013-07-04 17:43 · javaScript · jQuery

jQuery里$(this)和this的区别在哪?

jQuery里$(this)和this的区别在哪? 如果你要使用html元素本身的属性或方法就需要使用this,如果你要使用jQuery包装后的方法或属性就要$(this),一般则有如下的关系. $(this)[0] == this; 上文的代码是要使用this的地方是要调用表单form的有reset方法,而这一方法jQuery没有包装支持,所以才有this.reset(),也可以使用$(this)[0].reset(); 关于什么时候使用二者?可以看如下例子: <a href="http://segmentfault.com/q/1010000000125418" target="_bla…

2013-07-04 15:26 · jQuery

toggleClass()

toggleClass() <!DOCTYPE html> <html> <head> <style> p { margin: 4px; font-size:16px; font-weight:bolder; cursor:pointer; } .blue { color:blue; } .highlight { background:yellow; } </style> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> </head> <body> <p class="blue">Click to toggle</…

2013-07-02 12:07 · jQuery

jquery 模拟事件的例子,触发自定义事件

1、 模拟事件的例子 <html> <head> <script type="text/javascript" src="c:\jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("button").click(function(){$("p").click();}); // 模拟点击p.click 事件 $("p").click(function(){ alert($("p").html()); }); }); </script> </head> <body> <butto…

2013-07-01 10:16 · jQuery

jquery给div的innerHTML赋值

jquery给div的innerHTML赋值 jquery给div的innerHTML赋值 $("#id").html("test"); // 下面这种赋值方式在1.9中不行了。 $("#id").html()="";

2013-06-20 16:31 · jQuery

触发 mouseover 事件和 mouseenter 事件 的区别

来源: http://www.w3school.com.cn/tiy/t.asp?f=jquery_event_mouseenter_mouseover <html> <head> <script type="text/javascript" src="/jquery/jquery.js"></script> <script type="text/javascript"> x=0; y=0; $(document).ready(function(){ $("div.over").mouseover(function(){ $(".over span").text(x+=1); }); $("…

2013-06-17 15:02 · javaScript · jQuery

JQuery的bind方法传递多个参数

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title> New Document </title> <script src="c:\jquery.js"></script> </head> <script> $(function(){ $('#mybtn').click({a : 'hello', b : 'world'}, myFun); }); function myFun(e) { alert(…

2013-06-14 14:50 · jQuery

jQuery动态添加<input type="file">

有时候需要在页面上允许用户上传多个文件,个数由用户自己决定,个数多了也可以删除,使用jQuery可以很简单的实现这个功能。 <!DOCTYPE html> <html> <head> <title>test.html</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <script type="text/javascript" src="jquery-1.6.4.min.js"></script> <script type="text/javascript"> //添加一行<tr> func…

2013-06-09 10:53 · jQuery

多个图片上传 js 预览功能

一 、方法1 来源: http://zhidao.baidu.com/question/281192956.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title> New Document </title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/java…

2013-05-15 14:44 · javaScript · jQuery