There is a site that works on chrome, mozilla, opera. And in IE and safari gives an error in this file

jquery-1.10.2.min.js

... globalEval: function(t) { t && x.trim(t) && (e.execScript || function(t) { e.eval.call(e, t) // строка 192 })(t) }, ... 

IE

SCRIPT1003: It is assumed to have ':'

File: jquery-1.10.2.min.js, line: 192, column: 9

safari

jquery-1.10.2.min.js: 192 SyntaxError: Expected an identifier but found '(' instead

UPD I tried to replace jquery-1.10.2.min.js with jquery-3.3.1.js

safari

 // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; // строка 5622 return elem; } 

jquery-3.3.1.js: 5622 TypeError: 'undefined' is not a function (evaluating 'elem.getAttribute ("type")')

UPD In globalEval in parameter t such script is transferred

 View ( "TotalsInfoView", {}, ( function() { var p = { init: function(config) { this._config = config; this._super("totalsInfoView"); this._total1Label = new TextView("textField totalLabel", config.total1Label, 0, 4); this._total2Label = new TextView("textField totalLabel", config.total2Label, 0, 4); this._total10 = new MTextView("textField total0", 0, 4, "totalCur", 100000); this._total20 = new MTextView("textField total0", 0, 4, "totalCur", 100000); this.addChild(this._total1Label); this.addChild(this._total10); this.addChild(this._total2Label); this.addChild(this._total20); this._total10.curType(config.curType); this._total10.noCo(config.noCo); this._total20.curType(config.curType); this._total20.noCo(config.noCo); this.setZIndex(111); positionFields.call(this); }, updateTotal1(value) { this._total10.mValue(value); positionFields.call(this); }, updateTotal2(value) { this._total20.mValue(value); positionFields.call(this); } }; function positionFields() { var self = this; setTimeout ( function () { self._total1Label.x(118); self._total10.setPosition(self._total1Label.x() + self._total1Label.getWidth() + 10, 4); self._total2Label.x(self._total10.x() + self._total10.getWidth() + 30); self._total20.setPosition(self._total2Label.x() + self._total2Label.getWidth() + 10, 4); }, 0 ); } return p; } ) () ); 

UPD All the functionality has not yet worked, but there is no error at this point, after correcting updateTotal1 (value) on updateTotal1: function (value) is similar and updateTotal2

  • Obviously, the problem is not in jquery itself, but in other scripts that access this jquery and push some trash into it (or, more precisely, the fact that IE and Safari for some reason were considered rubbish). Dig into your site and create a minimal reproducible example , otherwise it will not work - andreymal
  • @andreymal trying. You do not tell me how to catch the code that calls these functions? - ArtGrek13
  • one
    e.eval.call (e, t) // string 192 Here, e is a reference to the window object? - Confireus
  • @ ArtGrek13 is the most banal way - to disable all your scripts (or individual functions inside the script) until the error disappears. When, after the next shutdown, the error disappeared, it means the error is somewhere in the last disabled script :) Well, in general, the browser should in an amicable way bring the stack along with the error, from which it would be possible to find out who exactly turned to jquery (and in browsers there are debuggers) - andreymal
  • @andreymal a script is stored in the variable t, apparently which should be executed by the eval.call command, eval.call can eval.call it, I don’t see any errors - ArtGrek13

1 answer 1

I propose that the failed function be stated as follows:

 / Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { if(elem.nodeType == undefined) return; if(elem.nodeType != 1) return; elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; return elem; }