title: Can't compare Jquery ajax object in IE
body: <p>Basically I'm using jquery's ajax call to get an html page.  On success, a data object is returned.  I want to compare this data object to a string to determine what I need to do with it.  This works fine in Firefox and Chrome but does not work in IE.</p>
  
  <pre><code>$.ajax({
    url: 'https://httpbin.org/get',
    type: 'GET',
    dataType: 'html',
    cache: false,
    success: function (data){ 
      if(data.endsWith('someTestString')) {
         //Do something
         console.log('hi');
      } else {
         //Do some other Thing
          console.log('hi2');
      }
    },
    error: function() {
      console.log('there was an error');
    }
  });
  </code></pre>
  
  <p>In IE I get the following error on this line if(data.endsWith('someTestString')) {</p>
  
  <blockquote>
    <p>Object doesn't support property or method 'startsWith'</p>
  </blockquote>
  
  <p>I've tried using a couple ways to cast data to a string, so far nothing has worked.  So far I have tried:</p>
  
  <p>data.toString()</p>
  
  <p>string var = '' + data + '';  //Then compare to a string, still get an error</p>
  
  <p>Here is the jsfiddle for this:
  <a href="https://jsfiddle.net/qcy02eae/" rel="nofollow">https://jsfiddle.net/qcy02eae/</a></p>
  
  <p>Any help would be greatly appreciated!</p>