Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE-11: Object doesn't support property or method 'parseInt'

My apps front end is built in angular js 1.4.14 and I am encountering the following error only in IE-11:

Object doesn't support property or method 'parseInt'

Here is my Html:

<div class="form-group">
     <label class="col-sm-2 control-label">Pickup time <span ng-show="pickupTimeIsRange()">range</span>:</label>
           <div class="row col-md-10">
                <div class="col-md-3">
                     <input placeholder="{{ pickupTimeIsRange() ? 'Start time' : 'Time' }}" class="form-control" ui-timepicker ng-model="info.pickup_time_start">
                </div>
                <div class="col-md-3" ng-show="pickupTimeIsRange()">
                     <input placeholder="End time" class="col-md-4 form-control" ui-timepicker ng-model="info.pickup_time_end">
                </div>
           </div>
</div>

And here is my js code:

info.pickup_time_start = getTime('start');
info.pickup_time_end = pickupTimeIsRange() ? getTime('end') : null;

function getTime(time) {
   return !_.has(info.pickup_time, time) || _.isEmpty(info.pickup_time[time])
        ? null
        : moment(info.pickup_time[time], 'HH:mm');
}

Now, what is going wrong here? My code is compiled when the app is run so the above error occurs in lib.js file which is a compiled js code file from which I don't know where actually Number.parseInt is being used. is there any way to force global parseInt to be used? Or is there any way I can figure out where exactly Number.parseInt is being used? I know that much that this error pops up when the above code runs, like when ui-timepicker is executed, when I try to select a time. So ui-timepicker is using Number.parseInt somewhere in the code which I am unable to figure out where exactly.

EDIT

By the way, it is working fine on my local with the same browser, same code, and same OS. That is very strange that on the live instance it doesn't work! Why is that?

like image 663
Saani Avatar asked Nov 12 '20 06:11

Saani


2 Answers

Well, I got to the issue. In my case jquery timepicker was being problematic. I updated it to the latest version available and issue is gone.

like image 50
Saani Avatar answered Oct 09 '22 07:10

Saani


You can check parseInt is used on line 841, https://github.com/wvega/timepicker/blob/master/jquery.timepicker.js

If you want to keep the older version you can update the lib and save it to your source files list

like image 1
Swaraj Gandhi Avatar answered Oct 09 '22 07:10

Swaraj Gandhi