How can I find whether a keyword exists in an array which was splitted with split()?
// Get the object infomation.
var keyword = 'story';
var path = $(this).find('a').attr('href');
var array_url = path.split('/');
if(keyword == array_url) alert('match!'); // does it work like this??
The url path from a tag is something like this - www.mysite.com/story/article-1
Thanks.
EDIT:
if ($.inArray(keyword, array_url)) alert('match!');
this will alert the match whether the array has the keyword in it or not.