Just wondering if there is a group rate at the Airport Hilton. Or if there is one in the works?
I called the Hilton last night and the person I spoke with didn't know of one, but she also had an amazingly difficult time understanding that jQuery was just one word and not the initial followed by a word (J. Query).
Hi. I was hoping someone could shed some light on a problem I'm seeing w/UI 1.7.2 that isn't present w/UI 1.5.3. I've got some mildly complicated code (or I'd post the whole thing here) that relies on draggable and droppable. It works fine in 1.2.6/1.5.3, but throws an error under 1.3.2/1.7.2 inside of the following code (which is part of jQuery UI): $.ui.plugin.add("draggable", "cursor", { start: function(event, ui) { var t = $('body'), o = $(this).data('draggable').options; if (t.css("cursor")) o._cursor = t.css("cursor"); t.css("cursor", o.cursor); }, stop: function(event, ui) { var o = $(this).data('draggable').options; <===== $(this).data("draggable") is undefined if (o._cursor) $('body').css("cursor", o._cursor); } }); The code in 1.7.2 apparently expects that the draggable element has some associated data but it seems not to be there. Again, this isn't a problem in 1.5.3. The logic in question is using draggable and droppable to implement dragging grid (table) columns around to reorder the columns. When a column is dropped, it blows away the elements in the table's thead and tbody and regenerates the HTML for them using the new column sequence. Stepping through the code, I can see that my logic that dumps and re- renders the HTML occurs before the above problem line is hit. Which I guess might be the problem. But then why isn't it a problem in 1.5.3? I'm kind of stumbling around a bit on this so any thoughts as to what might be the cause/solution for this would be very much appreciated. Thanks, Andy
Couple questions for the jQuery internals-aware folks. This is a bit long, sorry for that. I'm working on beefing up error handling in a web application. I want to ensure that I'm catching all exceptions and handling them via my own UI system. The window.onerror function is part of the solution, but there's a known problem with Firefox (https://bugzilla.mozilla.org/ show_bug.cgi?id=312448) that prevents onerror being called when the exception is thrown inside an event handler. In looking for a solution that didn't require mucking about with each instance of event binding logic throughout the app, I ran across what seems like a reasonable solution here: (http://blogs.cozi.com/tech/ 2008/04/javascript-error-tracking-why-windowonerror-is-not- enough.html). The general idea is to override bind() and replace the passed in handler function with a function that wraps the original handler function in a try-catch block. So the code would look something like this: var jqBindFn = jQuery.fn.bind; $.fn.bind = function(type, data, fn) { if (!fn && data && typeof data === 'function') { fn = data; data = null; } if (fn) { var ofn = fn; var wfn = function() { try { ofn.apply(this, arguments); } catch ( ex ) { someGlobalErrHandler( ex ); } }; fn = wfn; } return jqBindFn.call(this, type, data, fn); }; Since all other event binding goes through bind(), it seems like this will easily add exception handling to all event handlers in my app. So I have two questions about this: (1) I haven't been using Javascript terribly long, so I'm not really sure if this approach has any significant costs or downsides. I mean, there's a performance hit by having the extra function calls. And again I suppose for the exception handling. But are there potential memory leak issues or is the performance hit likely to increase the longer a user uses an app with that "fix" in it? (2) It sort of seems like Mozilla isn't in any giant hurry to fix there bug. It probably doesn't make sense to add code to jQuery core to work around such an obscure bug for it's own sake. But I wonder if adding some exception handling capability to jQuery core makes any sense? It could do what it does for other areas of Javascript which is mitigate the browser differences. To be complete, it would need to employ onerror, add a try-catch block to document.ready(), and do something similar to the above for event handlers (only in mozilla). Thoughts? Is this just stupid?
I'm working on a small plugin that extends a checkbox to behave as if it has 3 states. Basically it just adds an anchor above the underlying checkbox, intercepts mouse clicks, and cycles the checkbox between: disabled + unchecked enabled + unchecked enabled + checked It works fine in FF. But in IE7, for some reason, the click events are always sent to the underlying checkbox instead of the overlaid anchor. The anchor is sized to completely overlay the checkbox (and in fact, I made it's slightly bigger so clicking at the very edges works). Incidentally, I'm using jQuery 1.2.6 since this is part of a much larger web application and we haven't yet worked out the incompatibilities we're seeing with the latest jQuery version. Here's the plugin code (the alerts are for debugging in IE; please don't beat up on me too bad - it's an early work-in-progress): (function($) { $.fn.checkbox3s = function(options) { var opts = $.extend({}, $.fn.defaults, options); return this.each(function() { var proxy, cbx = $(this), parent = cbx.parent(); parent.css({position:"relative"}); proxy = $("<a href='#'></a>").css({ position:"absolute", display:"block", padding:"0", margin:"0", textDecoration:"none", left: "0px", top: "0px", width: "100%", height: "100%" }).appendTo(parent).click(function(e) { if (cbx.is(":disabled")) { alert("disabled - enabling and unchecking"); cbx.attr({disabled: false, checked:false}); } else if (cbx.is(":checked")){ alert("enabled & checked - unchecking & disabling"); cbx.attr({checked:false, disabled:true}); } else { alert("enabled & unchecked - check"); cbx.attr({checked:true}); } return false; }); cbx.attr({checked:false, disabled:true}).css ({position:"relative"/*, zIndex:499*/}).click(function(){return false;}); }); }; $.fn.checkbox3s.defaults = {}; })(jQuery); Anyone know why this would work okay in FF but not in IE (besides the obviousness that IE sucks)? Thanks, Andy
powers-that-be: It's a good thing that this group is moderated. But I was wondering how many messages I need to post before I get unmoderated? It's kind of a drag to respond to a thread and find that by the time the response becomes visible, the response has become obsolete. Also, does being unmoderated in one jQuery discussion group, unmoderate me in the others? Or are they individual? I'm also a member of the jQuery UI group. Thanks, Andy
If I have a table: <table> <tbody> <tr><td><span></span></td>/*many more cells here*/</tr> <tr><td><span></span></td>/*many more cells here*/</tr> // many more rows here... <tbody> </table> And I'm handed a reference to a <span> inside one of the table cells, what's the quickest method to obtain the row that contains the span? Is this as fast as it gets? $(theSpan).parents('tr:first'); Does that even work? Does ":first" work when climbing upwards through the ancestry? Thanks, Andy