When I include only jQuery 1.4 library, I get an exception, why?

I keep getting this error everywhere where I just included jquery 1.3 or 1.4.

"setting a property having only a getter"

and a long list of warnings in the Firefox error console.

What's happening? I can not find information on this problem = /

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
<head>
  <title>Demo</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
    <link rel="shortcut icon" href="images/favicon.ico">
    <link rel="stylesheet" href="css/common.css" type="text/css" /> 
    <link rel="stylesheet" href="css/modules.css" type="text/css" /> 
    <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script> 
</head>  

Just some snippets of warnings:

Warning: reference to undefined property a[++e] 
Source File: /js/jquery-1.4.2.min.js 
Line: 30 
Warning: reference to undefined property a[0] 
Source File: /js/jquery-1.4.2.min.js 
Line: 30 
Warning: function oa does not always return a value 
Source File: /js/jquery-1.4.2.min.js Line: 18, Column: 165 
Source Code: th;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,
+3
source share
2 answers

Do you have an operator "use strict";anywhere? This causes ECMAScript5 browsers to parse JavaScript a little differently and may cause it to return as an error.

, , , use strict. , use strict , . , jQuery , , :

//load jQuery here

//create a scope
(function() {
     "use strict";
     // your code here
})();
+2

, , .

OP, , , about: config Firefox.

, about:config Firefox, javascript.options.strict, "false".

+2

Source: https://habr.com/ru/post/1735631/


All Articles