Skip to main content

Bug Tracker

Side navigation

#12774 closed bug (duplicate)

Opened October 20, 2012 11:51PM UTC

Closed October 21, 2012 12:51AM UTC

Bug on jQuery 1.8.2 when using it on a Firefox Extension

Reported by: joydragon@gmail.com 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

Attachments (0)
Change History (2)

Changed October 21, 2012 12:34AM UTC by mikesherov comment:1

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

Changed October 21, 2012 12:51AM UTC by gibson042 comment:2

resolution: → duplicate
status: newclosed

Duplicate of #12357.