jquery 选中checkbox兼容问题
来源:互联网 发布:台服dnf登陆器源码 编辑:程序博客网 时间:2024/06/05 11:26
今天在做一个checkbox选中功能的时候,在本地测试已经通过,但是把代码上传到服务器上测试却是功能不能正常工作!最后老大告诉我本地和线上的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=gb2312" /><script src="lib/jquery-1.6.4.min.js" type="text/javascript"></script><!--script src="lib/jquery-1.4.4.js" type="text/javascript"></script--><script type="text/javascript">$(document).ready(function(){$("#jianrong").click(sovle_jquery_virsion);$("#test").click(function(){//如果是1.4版本得到的数据时boolean类型的//如果是1.6版本得到的结果是字符串if(true == $("#show_img_title").attr("checked")){alert("是字符串true");}if("checked" == $("#show_img_title").attr("checked")){alert("是字符串checked!");}});});//解决不同版jquery的问题,可以用下面的方式判断function sovle_jquery_virsion(){if("checked" == $('#show_img_title', parent.document.body).attr("checked") || true == $('#show_img_title', parent.document.body).attr("checked")){alert("多选框被选中!");}else{alert("多选框没有被选中!");}}</script><title>无标题文档</title></head><input type="checkbox" id="show_img_title" style="vertical-align:-3px;"><label style="margin: 0 0 0 4px;" for="show_img_title">照片标题描述带入日记</label><br><button id="test">test</button><br><button id="jianrong">兼容性问题测试</button><body></body></html>
- jquery 选中checkbox兼容问题
- jquery CheckBox 取消选中
- jquery checkbox选中问题
- jquery checkbox选中效果
- jquery判断checkbox选中
- jquery选中checkbox
- jquery checkbox选中值
- Jquery CheckBox选中事件
- 【jquery】checkbox选中事件
- jquery checkbox 选中方法
- jquery 实现checkbox选中,jquery checkbox
- jquery计算checkbox选中个数
- jquery判断checkbox是否选中
- jquery判断checkbox是否选中
- jquery 判断checkbox是否选中
- Jquery,checkbox是否被选中
- jquery判断checkbox是否选中
- JQuery 获取选中checkbox值
- 超易药品进销存软件 V3.11
- TextRange对象的学习(一)
- A标签触发onclick事件而不跳转
- 三个有关jsp页面操作的小错误 ¶
- Google Chart API 生成图片
- jquery 选中checkbox兼容问题
- 检测哪个HTML标签触发的事件
- div背景半透明 覆盖整个可视区域的遮罩层效果
- jquery.qtip插件的简单入门
- Mysql 5.6 双主配置 自动同步脚本
- jQuery模糊知识点
- 静态页面和动态页面的比较
- struts2自学笔记
- 右下角窗口提示