javascript - Call a function if a string contains any items in an array -


If a string contains items in any array, how can I call a JavaScript function?

Yes, I can use jQuery :)

using you A Mozilla extension that has been added to ECMAScript 5:

  var haystack = 'I like eggs!'; If (['spam', 'egg']. Some (function (needle) {return greenstack.indexoff (needle)> gt; = 0;})) warning ('spam or eggs');  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -