
Jquery
PerfectUrl
PHP 项目开发,Go项目开发
展开
-
jquery Ajax 异步传输
这里介绍三种常用的提交方式 方式一 手工收集所有的用户输入,封装为大的“k1=v1&k2=v2…”键值对形式,使用$.post(url, data,fn)把数据提交给服务器 $.ajax({ type:'post', url:'Notice_noTipsNotice', data:'k1=v1&k2=v2...',转载 2017-03-28 18:18:30 · 341 阅读 · 0 评论 -
js 手机触屏滑动置顶
$(function(){ var Width =document.documentElement.clientWidth;//取得手机屏幕宽度 var Height = document.documentElement.clientHeight; $(document).on('touchmove',function(){//将文档绑定手机滑屏事件 var TopV原创 2017-07-11 14:17:07 · 613 阅读 · 0 评论 -
jquery 对select中option的移动删除
/** * 向上移动选中的option */ function upSelectedOption(){ if(null == $('#where').val()){ alert('请选择一项'); return false; } //选中的索引,从0开始 var optionIndex = $('#where').get(0).selectedIndex; /翻译 2017-05-20 22:51:52 · 483 阅读 · 0 评论 -
(document).height()与$(window).height()
jQuery(window).height()代表了当前可见区域的大小,而jQuery(document).height()则代表了整个文档的高度,可视具体情况使用. 注意当浏览器窗口大小改变时(如最大化或拉大窗口后) jQuery(window).height() 随之改变,但是jQuery(document).height()是不变的。 $(document).scrol翻译 2017-05-19 12:02:26 · 286 阅读 · 0 评论 -
jquery 点击同类标签获取不同值
$(document).ready(function(){ $("li").click(function{ alert($(this).val()); }); });翻译 2017-05-10 10:36:01 · 784 阅读 · 0 评论 -
Jquery 表格操作
点击 不要忘记引入jquey $(function(){ //用jQuery获取table中td值 $("#mytable td").click(function(){ alert("tab转载 2017-05-25 10:13:42 · 274 阅读 · 0 评论 -
jquery select 移动
select 移动 <select multiple="multiple" id="shandong"> 青岛 烟台 济南 潍坊 <input type="button" value="-->" onclick="toRight()" /原创 2017-04-20 09:40:10 · 319 阅读 · 0 评论 -
jQuery each遍历数据组,json,对象
each $(document).ready(function(e) { $('tr:first').css("background-color","#FF0"); $('tr:gt(0):odd').css("background-color","#0FF"); }); //$.each(数组,function(K,V)) var color =['gold','ye原创 2017-04-05 11:53:23 · 425 阅读 · 0 评论 -
Jquery 复选框操作全
//注释 如果jquery版本太高 可把 attr不好使 可以用 prop $("document").ready(function(){ $("#btn1").click(function(){ $("[name='checkbox']").attr("checked",'true');//全选 }) $("#btn2").click(function(){ $("[na翻译 2017-04-10 14:40:04 · 344 阅读 · 0 评论 -
FileReader 实现预览图片
var result = document.getElementById("result"); var input = document.getElementById("file_input"); if(typeof FileReader === 'undefined'){ result.innerHTML = "抱歉,你的浏览器不支持 FileReader"; input转载 2017-04-10 17:16:37 · 950 阅读 · 0 评论 -
ajax 省份地区三级联动
var xmldom=null;//用于储存第一次请求的xml数据 function showprovince(){ $.ajax({ url:'ChinaArea.xml', dataType:"xml", success:function(msg){ xmldom = msg; //从父节点获取子节点 $(msg).find('province').each(function(原创 2017-04-08 15:25:25 · 619 阅读 · 0 评论 -
$.get()
function f1(){ /*$.get('./11.php',{name:'zhang',age:5},function(msg){ alert(msg); })*/ $.get('./11.php',function(msg,status){ //alert(msg); alert(msg.city); alert(status); },'json')//返回json 对象原创 2017-04-08 11:17:02 · 340 阅读 · 0 评论 -
$.ajax()
$.ajax({ url:'./11.php', data:{name:'zhang',age:5},//发送数据类型 dataType:'json',//返回数据格式 success:function(msg){ alert(msg); alert(msg.city);//获取对象内容 } }) //11.php ->>url:'./11.php',原创 2017-04-08 11:23:33 · 300 阅读 · 0 评论 -
jquery 图片自动刷新
/*应用定时器控制loading图片*/ function change(){ $("#image img").each(function(index,element) { $(this).attr({src:'img/loading2.gif'}); }); } setInterval('change()',1000);原创 2017-07-13 10:34:03 · 2841 阅读 · 1 评论