随笔分类 -  javascript

摘要:jQuery获取Select选择的Text和Value:语法解释:1. $("#select_id").change(function(){//code...}); //为Select添加事件,当选择其中一项时触发2. var checkText=$("#select_id").find("option:selected").text();//获取Select选择的Text3. var checkValue=$("#select_id").val();//获取Select选择的Value4. var checkIndex=$("#select_id ").get(0).selectedInde 阅读全文
posted @ 2011-01-12 10:05 演绎简单 阅读(305) 评论(0) 推荐(0)
摘要:concat将两个或多个字符的文本组合起来,返回一个新的字符串。var a = "hello";var b = ",world";var c = a.concat(b);alert(c);//c = "hello,world"indexOf返回字符串中一个子串第一处出现的索引(从左到右搜索)。如果没有匹配项,返回 -1 。var index1 = a.indexOf("l");//index1 =... 阅读全文
posted @ 2010-03-26 11:18 演绎简单 阅读(214) 评论(0) 推荐(0)
摘要:JS自带函数1.Asc(x),Chr(x):转换字符,字符码2。Filter:搜寻字符串数组中的特定字符串格式:v=filter(x,s[,include[,compare]])实例:Dim x()={"kjwang","wangkj","peter"}Dim vv=filter(x,"kj") '结果v(0)="kjwang",v(1)="wangkj"v=filter(x,"kj",false... 阅读全文
posted @ 2010-03-26 10:56 演绎简单 阅读(322) 评论(0) 推荐(0)
摘要:1、window.external...<INPUTonclick='window.external.ImportExportFavorites(true,"http://localhost%22);'type=buttonvalue=http//tech.ddvip.com/2008-09/导入收藏夹><INPUTonclick='window.external.ImportE... 阅读全文
posted @ 2009-11-04 09:48 演绎简单 阅读(261) 评论(0) 推荐(0)
摘要:设置或获取对象指定的文件名或路径。<script>alert(window.location.pathname)</script>设置或获取整个 URL 为字符串。<script>alert(window.location.href);</script>设置或获取与 URL 关联的端口号码。<script>alert(window.loc... 阅读全文
posted @ 2009-11-04 09:29 演绎简单 阅读(377) 评论(0) 推荐(0)