Script with .includes works fine in Chrome but not IE

Script with .includes works fine in Chrome but not IE

Hi,

I have a piece of JQuery Script that works fine in Chrome and Mozilla, but does not want to work in IE.  I read up on it and it said that IE does not support the include function. So I tried using indexof but that made it stop work in all browsers.  What can I use that will work in all browsers? I appreciate any help rendered.


  1. function sendCheck() {
  2. var valid;
  3. valid = validateCheck();
  4. if(valid) {
  5. jQuery.ajax({
  6. url: "verify_step1.php",
  7. data:'age='+$("#aRange").val()+'&fd='+$("#fdate").val()+'&ft='+$("#ftime").val()+'&td='+$("#tdate").val()+'&tt='+$("#ttime").val()+'&pul='+$("#floc option:selected").val()+'&dol='+$("#tloc option:selected").val(),
  8. type: "POST",
  9. success:function(data){
  10. $("#display").html(data);
  11. //if (data.indexof("Success") > -1){   // does not work in all browsers.
  12.                                 if (data.includes("Success")){    // works in all browsers except IE
  13. setTimeout(' window.location.href = "res_step2.php"; ',2000);
  14.                               }
  15. },
  16. error:function (){}
  17. });
  18. }
  19. }