$.inArray()使用方法
来源:互联网 发布:java hex jar包 编辑:程序博客网 时间:2024/04/29 20:50
$.inArray()
方法类似于JavaScript的原生.indexOf()
方法,没有找到匹配元素时它返回-1。如果数组第一个元素匹配value
(参数) ,那么$.inArray()
返回0。如果找到,则返回返回找到位置的数组下标值.
var event_id = $("#event_id").val();
if(!!event_id && ($.inArray(event_id,"undefined","null","0","false") == -1)){
location.href='http://action.juzilicai.com/event/'+event_id+'/index.html?id=1';
}else{
location.href='/register/success.html';
}
当event_id是undefined","null","0","false"中的情况或者0时,页面不会跳转到
location.href='http://action.juzilicai.com/event/'+event_id+'/index.html?id=1';
这个页面.
1 0
- $.inArray()使用方法
- $.inArray
- jquery $.inArray()
- jQuery.inArray
- js inArray() jQuery.inArray( value, array )
- jQuery.inArray(value,array)
- jQuery.inArray(value,array)
- indexOf() 与 jquery.inArray()
- jquery inArray JSON解析
- jquery.inArray函数
- $.inArray()——JQuery
- $.inArray函数用法
- jquery. inArray()函数详解
- jQuery.inArray() 函数详解
- jQuery.inArray() 函数详解
- $.grep(),$.map(),$.inArray()
- jQuery.inArray() 函数详解
- zepto的$.inArray用法
- Swift 读取,处理Json数据
- Python写的网络爬虫程序
- Unity 脚本生命周期流程图
- PHP的UTF-8中文转拼音处理类
- 三个基本设计模式
- $.inArray()使用方法
- Eclipse 如何添加 更换字体
- phantomjs 另类用法
- canvas rotate
- u-boot的Makefile分析
- 记录AS混淆代码模板
- 拥抱生活
- jsp表单提交的中文乱码问题
- 通过安卓应用获取任意蓝牙设备的MAC地址