随笔分类 -  JS

摘要:需要说明的这个jquery选择器必须是你解析组件的父级以上的节点。也就是说这个查找出来的节点相当于一个容器,它只会解析容器里面的内容。 阅读全文
posted @ 2016-10-14 15:44 贱书生 阅读(402) 评论(0) 推荐(0)
摘要:调用web接口,get请求,发现提示:No 'Access-Control-Allow-Origin' header is present on the requested resource. 这个和安全机制有关,默认不允许跨域调用 处理手段:使用jsonp格式, ajax请求参数dataType: 阅读全文
posted @ 2016-04-01 19:02 贱书生 阅读(730) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2014-11-18 17:21 贱书生 阅读(366) 评论(0) 推荐(0)
摘要:HTML代码: {$vo.name} JQuery代码:function edit(msg,id){ var text = $(msg).text(); $(msg).html("= 0 || name == ""){ alert("相册名称不能为空且不能含有空格!"); $("inpu... 阅读全文
posted @ 2014-11-13 10:18 贱书生 阅读(1673) 评论(0) 推荐(0)
摘要:1.js方法:function replaceErrorImg(obj){ obj.src="images/common/error.bmp";}2.jquery绑定$('img').error(function() { $(this).attr("src", "images/common... 阅读全文
posted @ 2014-11-13 10:16 贱书生 阅读(399) 评论(0) 推荐(0)
摘要:我们在平常使用Jquery异步提交表单,一般是在submit()中,使用$.ajax进行。比如: $(function(){ $('#myForm').submit(function(){ $.ajax({ url:"/WebT... 阅读全文
posted @ 2014-11-13 10:15 贱书生 阅读(4859) 评论(0) 推荐(0)