Bug Tracker

Opened 7 years ago

Closed 7 years ago

#12774 closed bug (duplicate)

Bug on jQuery 1.8.2 when using it on a Firefox Extension

Reported by: joydragon@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.2
Keywords: Cc:
Blocked by: Blocking:

Description

I don't really know why this happened, but when I tried to use the normal jQuery downloaded today on my Firefox extension it gave an error on the line 1262.

It's part of the jQuery.support method and it has the following code:

all = div.getElementsByTagName("*");
a = div.getElementsByTagName("a")[ 0 ];
a.style.cssText = "top:1px;float:left;opacity:.5";

The problem is that it's not validating that a element and somehow that selection is returned undefined.

My solution was to add a validation for undefined, but I don't really know the base problem.

all = div.getElementsByTagName("*");
a = div.getElementsByTagName("a")[ 0 ];
if(a !== undefined)
   a.style.cssText = "top:1px;float:left;opacity:.5";

Is that all right? It works for me but, is that the best approach?

Thanks!!

Joy Dragon unki no ryoushi

Change History (2)

comment:1 Changed 7 years ago by mikesherov

This is a dupe but I'm remote. Someone please find it and close this.

comment:2 Changed 7 years ago by gibson042

Resolution: duplicate
Status: newclosed

Duplicate of #12357.

Note: See TracTickets for help on using tickets.