Path: csiph.com!aioe.org!news.mixmin.net!weretis.net!feeder4.news.weretis.net!feeder5.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: Empty function Supersedes: <2789227.5fSG56mABF@PointedEars.de> Date: Sun, 08 Jan 2017 23:40:38 +0100 Organization: PointedEars Software (PES) Lines: 48 Message-ID: <1552504.VLH7GnMWUR@PointedEars.de> References: Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1483915239 18741 eJwFwYEBwDAEBMCVQvxjnCj2H6F3uBR+bgQNi51FtBwq1bZ3zhMwZdwitTobkefiSbDKY34VVBC4 (8 Jan 2017 22:40:39 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Sun, 8 Jan 2017 22:40:39 +0000 (UTC) User-Agent: KNode/4.14.2 Cancel-Key: sha1:Xj8tdn+mcEuOn7ifodz0V4jXPjw= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg== X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. […] Here is the complete code > > var Drag = { > obj: null, > init: function(o, posX, posY, minX, minY) { > if (!o) return; > o.onmousedown = Drag.start; > o.root = o; > o.root.style.left = posX + "px"; > o.root.style.top = posY + "px"; > o.minX = minX; > o.minY = minY; > o.root.onDragStart = function() {}; > o.root.onDragEnd = function() {}; > o.root.onDrag = function() {}; As indicated by “o.root.style”, “o.root” appears to store a reference to a DOM element object. In that case, the latter three lines are error-prone: They would only work in the MSHTML DOM before version 9 and any DOM compatible to it. In addition, the names of the standard event-handler properties are all-lowercase; so in a W3C DOM implementation the referred object does not have those properties. It is a host object, and assigning to potentially non-existing property of a host object, thereby attempting to augment it with properties, is a recipe for disaster. Since DOM element objects usually do not have “minX” and “minY” properties, the latter possibility is more likely. > }, > start: function(e) { > e = e || window.event; > var o = Drag.obj = this, > y = parseInt(o.root.style.top, 10), > x = parseInt(o.root.style.left, 10); > o.root.onDragStart(x, y); Given the augmented code, this line suggests that the author attempted to augment a host object (see above), and that they have no clue how to properly dispatch an event to such an object. -- PointedEars FAQ: | | Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.