开发者

jQuery check if Cookie Contains Text

Trying to check to see if a cookie contains specific value of text. Is there a way to do this? For instance, my current cookies value is 'www.yahoo.com', but this tells me that $.cookie("referrer") is null, when it is actuall开发者_开发百科y not:

  if ($.cookie('referrer').contains('yahoo')){
     alert('YOU CAME FROM YAHOO!') }


I believe cookie returns a string value which does not support contains in javascript. You should use indexOf.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜