indexOf 方法 (Array)
JavaScript
indexOf 方法 (Array) (JavaScript)
返回某个值在数组中的第一个匹配项的索引。
array1.indexOf(searchElement[, fromIndex])参数
参数
定义
array1
必需。 一个数组对象。
searchElement
必需。 要在 array1 中定位的值。
fromIndex
可选。 用于开始搜索的数组索引。 如果省略 fromIndex,则从索引 0 处开始搜索。
返回值
数组中的 searchElement 的第一个匹配项的索引;如果未找到 searchElement,则为 -1。
备注
indexOf 方法在数组中搜索指定的值。 该方法返回第一个匹配项的索引;如果找不到指定的值,则为 -1。
按升序索引顺序执行搜索。
数组元素将与 searchElement 值进行全等比较,与 === 运算符类似。 有关更多信息,请参见 比较运算符 (JavaScript)。
可选 fromIndex 参数指定用于开始搜索的数组索引。 如果 fromIndex 大于或等于数组长度,则返回 -1。 如果 fromIndex 为负,则搜索从数组长度加上 fromIndex 的位置处开始。
示例
下面的示例阐释了 indexOf 方法的用法。
1.// Create an array. (The elements start at index 0.)
2.var ar = ["ab", "cd", "ef", "ab", "cd"];
3.
4.// Determine the first location of "cd".
5.document.write(ar.indexOf("cd") + "<br/>");
6.
7.// Output: 1
8.
9.// Find "cd" starting at index 2.
10.document.write(ar.indexOf("cd", 2) + "<br/>");
11.
12.// Output: 4
13.
14.// Find "gh" (which is not found).
15.document.write (ar.indexOf("gh")+ "<br/>");
16.
17.// Output: -1
18.
19.// Find "ab" with a fromIndex argument of -2.
20.// The search starts at index 3, which is the array length plus -2.
21.document.write (ar.indexOf("ab", -2) + "<br/>");
22.// Output: 3
没有合适的资源?快使用搜索试试~ 我知道了~
超全 Lotus Domino Xpages 开发资料——xpages总结归类资料
共256个文件
doc:108个
docx:86个
txt:30个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 3 下载量 143 浏览量
2021-05-29
08:47:00
上传
评论
收藏 17.71MB RAR 举报
温馨提示
超全 Lotus Domino Xpages 开发资料——xpages总结归类资料 大全通过分类提供给大家,请大家根据需要下载 全开源,并且一看就懂,不保留 https://blog.csdn.net/weijia3624/article/details/107013401
资源推荐
资源详情
资源评论
收起资源包目录
超全 Lotus Domino Xpages 开发资料——xpages总结归类资料 (256个子文件)
动态加载js或css.doc 828KB
Exporting Grid Data.doc 466KB
EnhancedGrid Drag and Drop.doc 336KB
repeat显示记录序号.doc 303KB
控件只读方式.doc 296KB
Multi-Row Entries.doc 256KB
Additional Grid Features.doc 229KB
ss.doc 228KB
新窗口打开视图连接.doc 220KB
EnhancedGrid Context Menus.doc 217KB
Repeat显示富域值.doc 212KB
EnhancedGrid Printing.doc 198KB
input保存为数组值.doc 195KB
例子1.doc 192KB
Editing Data in the Grid.doc 171KB
Create a Dojo EnhancedGrid.doc 170KB
xpage连接MS SQL成功示例.doc 167KB
调用内存文档内容.doc 162KB
Enhanced Filtering with No Coding.doc 156KB
repeat放在table ul里面.doc 156KB
Opening Documents.doc 138KB
Full-text Search and Field-Specific Filtering.doc 133KB
超连接到文档.doc 131KB
组合框显示DB视图.doc 116KB
视图建立全文搜索.doc 113KB
view视图列数据过滤.doc 106KB
传参数给custom control.doc 105KB
禁止列排序.doc 105KB
Locking Columns.doc 97KB
Reordering Columns.doc 94KB
repeat行css.doc 92KB
Icon Columns.doc 91KB
引用JS和CSS.doc 87KB
列超链接.doc 83KB
列可以左右移动.doc 80KB
发邮件HTML.doc 73KB
Grid Column Features.doc 69KB
视图连接在新窗口打开.doc 68KB
Pass-through HTML Grid Columns.doc 66KB
Sorting.doc 66KB
视图CSS说明.doc 66KB
Date函数.doc 62KB
CSS视图为多平台.doc 61KB
xapges整个db不加载dojo.doc 58KB
综合.doc 57KB
partialRefreshPost.doc 57KB
computedField计算域用法.doc 55KB
NotesDateTime Date.doc 55KB
设置meta页面头.doc 50KB
Highlighting Edited Rows.doc 45KB
引用head说明.doc 39KB
导出excel.doc 36KB
CGI获取.doc 35KB
富文本域获取和保存.doc 35KB
调用内存文档代理-新8.5.2.doc 34KB
javabean.doc 34KB
富域的附件url.doc 33KB
combobox提前输入的值.doc 32KB
获取富域的html.doc 32KB
用户角色权限判断.doc 32KB
easyui引用.doc 32KB
获取当前用户邮件DB.doc 31KB
onload加载和其它方法.doc 31KB
附件显示序号和中文.doc 30KB
dblookup.doc 30KB
combobox可手动输入.doc 29KB
附件获取1.doc 29KB
js动态加载.doc 28KB
URL中文传值.doc 28KB
easyui在本数据库引用方法.doc 28KB
时间保存到文档格式.doc 27KB
时间给控件取赋值.doc 27KB
时间控件显示24小时制.doc 27KB
文档获取域值为数组值.doc 27KB
控件只读.doc 27KB
systemprofile.doc 26KB
Profie快速获取和保存.doc 26KB
ResultSet处理方式.doc 26KB
直接在页面写js和css.doc 26KB
postSave运行的前提条件.doc 25KB
页面嵌入其它网站.doc 25KB
服务器的html路径.doc 25KB
combobox默认空值.doc 25KB
权限设置html控件可见.doc 25KB
文档域赋间值.doc 24KB
把富域值动态写入CKEditor.doc 24KB
页面form的关闭和设置.doc 24KB
view每一列数据获取.doc 24KB
listbox.doc 24KB
页面打开后运行客户端js.doc 24KB
字符转数组文档域存数组.doc 24KB
文档的状态.doc 24KB
跳转到第一页.doc 24KB
获取视图分类的数据.doc 21KB
获取当前用户邮件DB.doc 21KB
获取服务器时间.doc 20KB
reset获取json数据.doc 20KB
checkBox.doc 20KB
调用公式.doc 20KB
获取用户所在群组.doc 20KB
共 256 条
- 1
- 2
- 3
资源评论
- qq_254506932021-06-07用户下载后在一定时间内未进行评价,系统默认好评。
- 2301_815006882024-01-18非常有用的资源,可以直接使用,对我很有用,果断支持!
weijia3624
- 粉丝: 613
- 资源: 719
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功