Search code examples
javascriptjquerystrstr

JavaScript or jQuery equivalent of PHP's strstr() function


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

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.


Solution

  • Ok I just found something that works!

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

    Thanks for your contributions :)