Bug Tracker

Modify

Ticket #1914 (closed bug: fixed)

Opened 6 years ago

Last modified 6 years ago

elem.style has no properties

Reported by: Digi Owned by:
Priority: major Milestone: 1.2.2
Component: core Version: 1.2.1
Keywords: Cc:
Blocking: Blocked by:

Description

Hello,

In firefox, when calling offset() from the dimensions pluggin, I occasionally get the error "elem.style has no properties  http://hacksim.metalaxe.com/testing/exploitos/jquery/jquery.js Line 698". This error happens every time when using IE7 as a browser. The error originates from a call to offset() on line 255 of battleship.js.

Test case can be found at:  http://hacksim.metalaxe.com/testing/programs/battleship/battlefield.html

To duplicate, especially in IE7, drag a ship from the right on to the grid in the "droppable" td's.

I've also attached battleship.js, battlefield.html and style.css for local testing. I'm using the SVN version of jquery.ui REV 3807

Attachments

battleship.js Download (7.1 KB) - added by Digi 6 years ago.
main javascript file for program operation
battlefield.html Download (6.3 KB) - added by Digi 6 years ago.
display page
style.css Download (1.1 KB) - added by Digi 6 years ago.
required styles

Change History

Changed 6 years ago by Digi

main javascript file for program operation

Changed 6 years ago by Digi

display page

Changed 6 years ago by Digi

required styles

comment:1 Changed 6 years ago by Digi

I forgot to mention. I'm using jquery core dated 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) and jquery.dimensions dated 2007-09-11 02:38:31 +0000 (Tue, 11 Sep 2007)

Thank you.

comment:2 Changed 6 years ago by Digi

Here's some backtrace information. I noticed that, for whatever reason, the element it is trying to access is the document itself. The line it is refering to in battleship.js (the version of this back trace) is as follows (jquery_ui is the second argument in findCell). Let me know if you need more information.

battleship.js (line 381-2) var droppable = jquery_ui.draggable.currentTarget; var droppable_inset_x = $(droppable).offset().left;

elem.style has no properties curCSS(Document battlefield.html, "position", undefined)jquery.js (line 698) css(Document battlefield.html, "position")jquery.js (line 675) offset()jquery.js (line 2908) findCell(Object type=drop target=img#bb.ships, Object draggable=Object droppable=Object)battleship.js (line 382) placePlayerShip(Object type=drop target=img#bb.ships, Object draggable=Object droppable=Object)battleship.js (line 268) drop(Object type=drop target=img#bb.ships, Object draggable=Object droppable=Object)battleship.js (line 152) trigger("drop", [Object type=drop target=img#bb.ships, Object draggable=Object droppable=Object], div.grid, false, function())jquery.js (line 1739) triggerHandler("drop", [Object type=drop target=img#bb.ships, Object draggable=Object droppable=Object], function())jquery.js (line 1885) drop(Object type=drop target=img#bb.ships)ui.droppable.js (line 149) (no name)(Object item=Object over=1 out=0 offset=Object)ui.draggable.js (line 47) grep([Object item=Object over=1 out=0 offset=Object, Object item=Object over=0 out=1 offset=Object], function(), undefined)jquery.js (line 981) fire(Object element=img#bb.ships options=Object opos=[2] pos=[2], Object type=drop target=img#bb.ships)ui.draggable.js (line 44) stop(Object interaction=Object plugins=Object, Object type=drop target=img#bb.ships)ui.draggable.js (line 154) _beforeStop(img#bb.ships v_battleship.png, [327, 270], Object top=17 left=13 bottom=18 right=0, Object element=img#bb.ships options=Object opos=[2] pos=[2], Object type=drop target=img#bb.ships)ui.draggable.js (line 89) stop(Object type=drop target=img#bb.ships)ui.mouse.js (line 195) mouseup(Object type=drop target=img#bb.ships)ui.mouse.js (line 115) handle(Object type=drop target=img#bb.ships)jquery.js (line 1776) (no name)()jquery.js (line 1620) [Break on this error] if (!force && elem.style[prop])

comment:3 Changed 6 years ago by brandon

  • Priority changed from blocker to major
  • Status changed from new to closed
  • Resolution set to fixed

It looks like your app is trying to get the offset of the document instead of an element and that is what is causing the error.

Hope to be able to see a finished version!

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.