Follow Me:
Showing posts with label Javascript. Show all posts
Showing posts with label Javascript. Show all posts

Sunday 30 November 2014

Contains() Property in javascript.,it is working fine in Mozila Firebox only.It will not support Chrome Browser,Internet Browser,Safari,Opera browser.


Mozila Browser :


  var ClearFilterValue  = 'family Schools';
    if(ClearFilterValue.contains("family")== true) {
   alert('Success');
    } 
  

Chorme & Mozila Firebox Browser :

    The below javascript index() properity will working for both chrome and mozile firbox.It is functionality similar to contains property.

var ClearFilterValue  = 'family Schools';
alert(ClearFilterValue.indexOf("family") != -1);

var n  =   str.indexOf("family"); 
if(n >= 0) { 
    alert(success); 
}