Bug Tracker

Ticket #9805 (closed bug: invalid)

Opened 3 years ago

Last modified 2 years ago

Error in Firefox 3.6.18 with minified jquery

Reported by: software Owned by: software
Priority: low Milestone: None
Component: misc Version: 1.6.2
Keywords: Cc:
Blocking: Blocked by:

Description

I have tested our webapplication in Firefox 3.6.18, Firefox 5, IE 8 and Chrome 12.0.742.112. This big appers only in Firefox 3.6.18 and only with jquery-1.6.2.min.js. With uncompressed version of jquery 1.6.2 (jquery-1.6.2.js) exists no problems.

Error in Firefox 3.6.18: Error: i.exec is not a function Sourcefile: ../jquery-1.6.2.min.js Row: 16

"i.exec" appers only one times in jquery-1.6.2.min.js. I looking for this equivalent in jquery-1.6.2.js and founded it on row 133.

Change History

comment:1 Changed 3 years ago by addyosmani

  • Owner set to software
  • Priority changed from undecided to low
  • Status changed from new to pending
  • Component changed from unfiled to misc

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket!

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate:  http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

comment:2 Changed 3 years ago by trac-o-bot

  • Status changed from pending to closed
  • Resolution set to invalid

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

comment:3 follow-up: ↓ 4 Changed 3 years ago by e.lestrade@…

I met the same issue and solved it.

It was caused by a variable called "i" which was wrongfully global in my code. Very classic mistake:
for(i = 0; i < max; i++) {

It did interfere with the minify version of jQuery which uses a variable named "i" that Firefox 3.6.18 considers as global for an unknown reason.

The same thing happens if you use a global variable name "quickExpr" with the uncompressed version of jQuery ("quickExpr" is the uncompressed version of "i").

That is why the problem happens only with minified versions, and only with specific Firefox versions.

Juste spent 2 hours on that one. Should use jslint...

comment:4 in reply to: ↑ 3 Changed 3 years ago by anonymous

So how did you resolve the issue? did you have to change your code, or the minified version of jquery?

comment:5 Changed 3 years ago by fai@…

I found the same issue too in FF 3.6.23, where the non-minified version worked fine.

To fix it, look for any "i" variables in your code and rename it to something else - i.e. iter

This cleared the issue and allowed the minified version to work again.

Typically the issue happens where jQuery is called in a scope where "i" is present (and I usually use "i" for loops - perhaps this could be corrected on the minifier?)

comment:6 Changed 3 years ago by timmywil

I'm confused. Neither quickExpr nor i is global even in the minified version of jQuery.

comment:7 Changed 3 years ago by anonymous

If it helps anyone, I had the same problem and after removing all instances of 'i' in my code finally traced it down to JQuery UI. If I include jquery-ui-1.8.16.custom.min.js I get the problem - it I do not use jquery-ui-1.8.16.custom.min.js the problem goes away.

I love JQuery, but I have to ask - why on earth use i globally in your compressed library? It is just asking for trouble - IMHO this IS a bug and should be fixed.

comment:8 Changed 2 years ago by USSR lover

Hi, I had such problem in FF 3.6.28 (and 1.5, 3.0.19). Fix - pack jquery.js with another packer. For example Dean Edvards packer., with unchecked "Base62 encode", "Shrink variables".

Note: See TracTickets for help on using tickets.