JavaScript或jQuery相当于PHP的strstr()函数 [英] JavaScript or jQuery equivalent of PHP's strstr() function

查看:109
本文介绍了JavaScript或jQuery相当于PHP的strstr()函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

jQuery或JavaScript中的函数是否与PHP中的 strstr()相同?

Is there a function in jQuery or JavaScript that does the same as strstr() in PHP?

我有一个应该是1,2,3,12,13,23或123的AJAX响应。我想检查1是否存在,然后如果2存在那么如果3存在。

I have an AJAX response that should be 1,2,3,12,13,23 or 123. I want to check if 1 exists, then if 2 exists then if 3 exists.

推荐答案

好的,我发现了一些有用的东西!

Ok I just found something that works!

http://my-sliit.blogspot.com/2008/06/search-string-javascript-喜欢-strstr-in.html

感谢您的贡献:)

这篇关于JavaScript或jQuery相当于PHP的strstr()函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆