随笔分类 - jquery
摘要:$("select[name='select_name']").find('option:selected').text(); $('#select_name option:selected').text();
阅读全文
摘要:何入手,请下载建站人目标,建站人建议见面沟通需求都是不要的。 根据与您为您提,并根据您的意见和建议进行完善。 在您最...
阅读全文
摘要:Javascript代码document.onkeydown=function mykeyDown(){ if(event.keyCode == 13) {checkData();} return; } 以上js代码在IE中运行正常,在Firefox中老报"event is not defined”错误!原因是因为在Firefox中使用了不同的事件对象模型,不同于IE Dom,用的是W3C Dom。Firefox DOM中并无event,采用以下方法解决,同时兼容IE和Firefox。Javascript代码document.onkeydown=fu...
阅读全文
摘要:示例:ajax返回的数组进行遍历 $.ajax({ type:"POST", url:"public_res/get_looked_comodity", dataType:"json", success:function(arr){ $.each(arr, function(key, val) { $("#car_list").append(''+val['name']+'¥'+val['price'...
阅读全文
摘要:获取所有name为spCodeId的checkbox var spCodesTemp = ""; $("input:checkbox[name=spCodeId]:checked'").each(function(i){ if(0==i){ spCodesTemp = $(this).val();
阅读全文
摘要:先需要form表单,获取短信的按钮做成两个相同的,一个显示,一个隐藏。 <div class="item"> <p class="item_p"> <label>手机号:</label> <input class="text js_name" type="text" name="moblie" va
阅读全文
摘要:$(function(){ $("#form1").click(function({ document.form_name.action="usercenter/change_username"; document.form_name.submit(); }))})注:如何document.form_name.submit()提示is not function是错误,需要检查一下form表单里是否有name为submit的元素。
阅读全文
摘要:/* 返回顶部 */ $(function(){ $(window).scroll(function () { if($(window).scrollTop() > 200)//距离顶部多少高度显示按钮 { $('.js_backup_top').slideDown(200); }else { $('.js_ba...
阅读全文
摘要:昨天弄了一下午,可谓的错误接连不断,心情莫名烦燥了,心理素质有待提高。。。做此功能:利用ajax上传文件,处理文件,返回文件名,再和其它域一块提交光ajaxfileupload.js插件就找了好几个,老报错,总感觉是插件下载的不对。。html部分:<html> <head> <title>Ajax File Uploader Plugin For Jquery</title> <meta http-equiv="Content-Type" content="text/html"; charset=&q
阅读全文
摘要:<html><head></head><body><script>function delConfirm(){ if(confirm("确定删除该记录吗?删除将不能恢复!")) return true; else return false;}</script><a href="http://www.baidu.com" onclick="return delConfirm()">删除</a></body></html>
阅读全文
摘要:jQuery.validate是用js来编写的jquery验证框架。下面来谈下各种使用方法吧首先需要引入jquery.js和validate.js,然后,载入validate函数,<script src="./jquery-1.7.js" type="text/javascript"></script><script src="./jquery.validate.js" type="text/javascript"></script>$(document).ready
阅读全文

浙公网安备 33010602011771号