Re: [jQuery] Custom headers to ajax calls
Safari crashed for me. :( IE6 and IE7: 2 failures: 24. core module: not(String) (1, 1, 2) not('selector') not('selector, selector') expected: [object],[object],[object], [object], result: [object],[object],[object],[object],[object] 70. ajax module: $.ajax - preprocess (1, 0, 1) check return value, should be the custom header sent I also did some tcpdumps and poked through them in wireshark. Eventually it dawned on me that your problem with setting custom headers is that IE may only accept valid HTTP headers -- something in the HTTP specs, something IE specific, or an X-* header. Note that x- requested-with is definitely working for both IE6 and IE7. Try X- Custom-Header and see what happens. Corey On Dec 4, 2006, at 12:38 PM, Jörn Zaefferer wrote: Corey Jewett schrieb: Do you have an isolated test case proving IE is ignoring setRequestHeader? It's part of the testsuite, available in SVN. It's a bit complicate to isolate the problem: I'm not sure what is happening on the serverside and I can't debug it. I can't even see what is actually send in IE (no Firebug...). I uploaded the compiled testsuite here: http://fuzz.bassistance.de/ie-requestheader/test/index.html Would be nice to see if this works in Safari... -- Jörn Zaefferer http://bassistance.de ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Custom headers to ajax calls
Do you have an isolated test case proving IE is ignoring setRequestHeader? Corey On Dec 4, 2006, at 11:47 AM, Jörn Zaefferer wrote: Mike Alsup schrieb: preprocess: function(xml) { The form plugin uses 'before' for the preprocess hook. For consistency, maybe using that name would be a good idea. Done. Still, setting custom request headers in IE(5 - 7) fails, anyone got any clue? http://jquery.com/dev/bugs/bug/384/ -- Jörn Zaefferer http://bassistance.de ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Hiding a row in a table
They're identical. John coded parents(), and then for semantic correctness and compatibility with XSLT added the ancestors() alias. Corey On Nov 27, 2006, at 2:26 PM, Erik Beeson wrote: Not if you have well formatted tables. There should be a TD between the A and TR. You could do .parents('tr'), which is the same as ancestors. Not to hijack this thread, but maybe someone who is more familiar could share with us which function is preferred, parents or ancestors? --Erik On 11/27/06, Brandon Aaron [EMAIL PROTECTED] wrote: On 11/27/06, Bruce MacKay [EMAIL PROTECTED] wrote: Thanks Erik, Unfortunately your line of code hid all the rows in the table, including the one that was clicked. If I just wanted to hide the row that was clicked, how would your line be altered? You could try to just call .parent('tr') instead of ancestors. -- Brandon Aaron ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery 1.1 by the end of Nov
Glad to hear it worked for somebody. This is really just a repurposing of the existing build system. It uses the same packing routines as the current build does. If John wants to move it over to the main site I'd be more than happy to at least have it out there as another option. Corey On Nov 16, 2006, at 6:35 AM, Karl Swedberg wrote: On Nov 15, 2006, at 4:26 AM, Corey Jewett wrote: Just throwing a little fuel on the fire. If anybody cares give this a whirl -- build your own custom jQuery. Maybe I'll figure out how to do plugins if anyone is interested. http://corey.jquery.com/cgi-bin/make.cgi Corey Corey, that is a very cool tool. what a great one-stop shop for jQuery developers to build their source! Especially useful, I'm sure, for people who can't access SVN because of firewall restrictions. Just for kicks, I built 1.0.3 with no additional core fragments in Lite mode, which removes /* */ comments. Then I stripped out all single-line comments and empty lines. With the introductory licensing comments still included, the file came to 838 lines of code and 28k -- uncompressed! Cheers, Karl ___ Karl Swedberg www.englishrules.com www.learningjquery.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery 1.1 by the end of Nov
Just throwing a little fuel on the fire. If anybody cares give this a whirl -- build your own custom jQuery. Maybe I'll figure out how to do plugins if anyone is interested. http://corey.jquery.com/cgi-bin/make.cgi Corey On Nov 14, 2006, at 9:32 PM, John Resig wrote: I definitely agree. I'm going to propose this course of action: 1) Strip out all helper functions into an external plugin. 2) Change the official (in SVN) plugins to no longer use the helpers. 3) Change all docs to no longer use the helpers. This will clear up documentation and reduce the filesize (win-win!) I'm going to persue this avenue long before having mutlitple builds (which only tends to complicate the matter). --John On 11/14/06, Blair McKenzie [EMAIL PROTECTED] wrote: I've been thinking the same thing actually. The messiness of three functions for every event (bind, unbind, and trigger) outweighs the convenience. I think that all these macros should be spun out into a plugin so that they can still be included for backwards compatibility when necessary. Blair On 11/15/06, dave.methvin [EMAIL PROTECTED] wrote: John Resig wrote: Right now, the jQuery compressed build is teetering around 18-19KB, I really want to try and cut this down. Any thoughts on particular features that should be extracted into a plugin? I know the macros don't account for _that_ much core code but they do complicate the documentation significantly. We have nice short names like .attr and .css yet those represent the most-macroed properties. Then we end up with (justifiable IMO) situations where valuable names like .height() are taken by the .css(height) macro to save five--count 'em--five characters. The same goes for the event macros, I think they account for more than half the names in the API documentation at this point and they end up creating situations like .unload() that are pretty hard to explain. I would like to see jQuery take more of a Perl path than a PHP one, using a small number of consistent and powerful concepts plus the ability to extend things with plugins. Perl has one simple consistent regexp operator; PHP has two completely different regexp engines, each served by a dozen or more differently named functions. -- View this message in context: http://www.nabble.com/jQuery-1.1-by-the-end-of-Nov- tf2631987.html#a7351892 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery 1.1 by the end of Nov
The problem with all this is that 4 js files totaling 20K is will typically make your page load slower than 1 20K JS file. There are a couple reasons: 1) round trip time per each additional requests for each file. Roughly equivalent to ping lag + server processing time. I wouldn't be surprised if this was an extra 250 millis per request. 2) the HTTP RFC suggests a maximum of 4 open connections from a client to a server. More files == larger backlog of files == poorer utilization of broadband connections. 3) HTTP pipelining (assuming it's even turned on, which it frequently isn't since it wastes server resources) can theoretically mitigate #2, but will not do much for #1. It'll cut out repeated setup and teardown of TCP stacks. 4) I haven't done any recent research on it, but don't browsers tend to cache JS files anyway? Now having said all that, if you still want to whittle down the file size, can I make a vote to maybe yank serialization, but nothing else. From the response so far it appears that there's a pretty even split between people who use/don't FX and/or AJAX. Meaning that pulling either one out is sure to screw up the other half. I could get on board with releasing several packages, as somebody suggested: JQuery: src/jquery + src/events + src/fx + src/ajax JQuery-fx-only: src/jquery + src/events + src/fx JQuery-ajax-only: src/jquery + src/events + src/ajax Jquery-dom-only: src/jquery + src/events JQuery-lite: src/jquery This just seems likely to generate a lot of extra support problems on the mailing list. Can't we just leave it up to people to build their own if they really want to cut it down below 20K? Corey On Nov 14, 2006, at 2:22 PM, Stephen Woodbridge wrote: John, That is why I think some prepackaged packages might work better in the short term. Longer term we might want to have plugins define a requires statement so that is would be easier for a build system to pull in all the required modules. -Steve John Resig wrote: I'm all for the custom build feature - in fact it was one of the first things included on the jQuery home page when it first launched back in Jan. (I removed it at the 1.0 launch, because it was broken). My biggest worry about having custom builds is that if a user sees something in the documentation (e.g. .height()) and then it doesn't work at all, that'll cause a lot of confusion. Figuring out what package everything is in. It is for this reason that I think any sort of package system has to be documented very explicitly so that people know what they're getting in to. This would also require that all demos, tutorials, and plugins use the lowest comon denominator of code (which will require a lot of rewriting). In all, it's very tricky, and something that we'll want to consider carefully. --John On 11/14/06, Stephen Woodbridge [EMAIL PROTECTED] wrote: I think that it would be great if we had a few bundled flavors like: jQuery-minimal.js jQuery-lite.js jQuery-standard.js jQuery-heavy.js This way we get the benefit of claiming all the features and can claim starting at only xx bytes based on the packed size of the minimal flavor. Providing a other flavors makes it easy for uses to grab a package of features without having to deal with build issues. -Steve John Resig wrote: Hi Everyone - I want to start a discussion about the features that should go into (or be removed from) the upcoming 1.1 release. I'd like to shoot for a release by the end of this month. I know that Joern already has some event code, ready to be committed - and I have the non-destructive jQuery code ready to go. Brandon mentioned that he wants to rewrite the jQuery.attr() in time for release too. No significant features are going to be added to this release, think of it as jQuery 1.0++. Right now, the jQuery compressed build is teetering around 18-19KB, I really want to try and cut this down. Any thoughts on particular features that should be extracted into a plugin? For example: Since the 'form' plugin already does serialization really really well (much better than jQuery's serialization). I'm tempted to remove the serialization plugin from core and just defer everyone to using the form plugin. Also, stuff like .height() and .width() could be removed in favor of using the (more powerful) methods of the same name in the 'Dimensions' plugin. Let me know if you have any ideas. --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Queueing of effects (fx)
I could be wrong, but I'm pretty sure fx are automatically queued. Something John did about 2 months ago. There's not a commit log for the actual queuing, but there is one for a bug fix: r209 | john | 2006-08-16 19:38:34 -0700 (Wed, 16 Aug 2006) | 2 lines Changed paths: M /jquery/src/fx/fx.js Fixed the issue with queued effects becoming corrupted. Corey On Oct 9, 2006, at 9:13 AM, Abdur-Rahman Advany wrote: Sam, Yeh, but using queue's allows that events don't fire a fx during some other fx... I can't do that with callbacks... Sam Collett wrote: On 09/10/06, Abdur-Rahman Advany [EMAIL PROTECTED] wrote: Hi guys, I was searching if there was a way to do queuing like in script.aculo.us (I am switching to jquery but this is the only bump) Here some doc's on how it works in script.aculo.us http://blog.railsdevelopment.com/pages/effect/queue/ Have you tried using callbacks? they are fired whenever an effect finishes. $(#mydiv).fadeOut(slow, function() { $(#mydiv2).fadeIn(slow); }) ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] New plugin: sparkline
Fixes for Safari: * Apple added Canvas for Dashboard (Tiger) and backported to Panther (as Safari 1.3), in the Mac world that's virtually everyone. Therefore, I added an explicit pass through for Safari because I can't find documentation for proper object detection. :( * The correct usage of stroking is to define the start point (moveTo), followed by your other commands (lineTo, etc).[2] * I back tested against FireFox 1.5 (OS X), don't have anything else handy at the moment. Sorry. Corey 1. http://developer.apple.com/documentation/AppleApplications/ Reference/SafariJSRef/Classes/Canvas.html#//apple_ref/doc/uid/ 30001240-53879 2. http://developer.apple.com/documentation/AppleApplications/ Reference/SafariJSRef/Classes/Canvas.html#//apple_ref/doc/uid/ 30001240-54100 --- sparkline.js2006-10-09 13:53:09.0 -0700 +++ sparkline.safari.js 2006-10-09 13:54:53.0 -0700 @@ -62,7 +62,7 @@ jQuery('#x_x_x').remove(); // Use a canvas element - if (options.useCanvas window.CanvasRenderingContext2D) { + if (options.useCanvas (window.CanvasRenderingContext2D || jQuery.browser.safari)) { var id = '__' + (new Date).getTime(); w = options.width * data.length; @@ -84,7 +84,12 @@ c.beginPath(); for (var i = 0; i data.length; ++i) { var v = Math.floor (((data[i] - min) / (max - min)) * h); - c.lineTo(w * i / (data.length - 1), h - v); + + if (i == 0) { + c.moveTo(w * i / (data.length - 1), h - v); + } else { + c.lineTo(w * i / (data.length - 1), h - v); + } } c.stroke(); } On Oct 7, 2006, at 3:56 AM, Franck Marcia wrote: Hi all, I've released a new plugin: sparkline. A sparkline is an inline graphic (http://www.edwardtufte.com/bboard/q-and-a-fetch-msg? msg_id=0001ORtopic_id=1). I borrowed the idea (and most of the code) from the TiddlyWiki project, a very good one-page wiki (http://www.tiddlywiki.com). Thanks to Jeremy Ruston for his work and his permission. Here is the link to the test page: http://fmarcia.info/jquery/sparkline/sparkline.html It's tested successfully on Windows XP with FF1.5.07, IE5.5, IE6, IE7RC1 and Opera 9.02. However, even if it works fine with FF on Linux, it doesn't behave correctly with Konqueror. I assume it's the same with Safari... As usual, any comment appreciated. Cheers, Franck. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] New plugin: sparkline
Argh! Does the ML reformat email? sparkline.js-safari.patch Description: Binary data On Oct 9, 2006, at 2:03 PM, Corey Jewett wrote: Fixes for Safari: * Apple added Canvas for Dashboard (Tiger) and backported to Panther (as Safari 1.3), in the Mac world that's virtually everyone. Therefore, I added an explicit pass through for Safari because I can't find documentation for proper object detection. :( * The correct usage of stroking is to define the start point (moveTo), followed by your other commands (lineTo, etc).[2] * I back tested against FireFox 1.5 (OS X), don't have anything else handy at the moment. Sorry. Corey 1. http://developer.apple.com/documentation/AppleApplications/ Reference/SafariJSRef/Classes/Canvas.html#//apple_ref/doc/uid/ 30001240-53879 2. http://developer.apple.com/documentation/AppleApplications/ Reference/SafariJSRef/Classes/Canvas.html#//apple_ref/doc/uid/ 30001240-54100 --- sparkline.js2006-10-09 13:53:09.0 -0700 +++ sparkline.safari.js 2006-10-09 13:54:53.0 -0700 @@ -62,7 +62,7 @@ jQuery('#x_x_x').remove(); // Use a canvas element - if (options.useCanvas window.CanvasRenderingContext2D) { + if (options.useCanvas (window.CanvasRenderingContext2D || jQuery.browser.safari)) { var id = '__' + (new Date).getTime(); w = options.width * data.length; @@ -84,7 +84,12 @@ c.beginPath(); for (var i = 0; i data.length; ++i) { var v = Math.floor (((data[i] - min) / (max - min)) * h); - c.lineTo(w * i / (data.length - 1), h - v); + + if (i == 0) { + c.moveTo(w * i / (data.length - 1), h - v); + } else { + c.lineTo(w * i / (data.length - 1), h - v); + } } c.stroke(); } On Oct 7, 2006, at 3:56 AM, Franck Marcia wrote: Hi all, I've released a new plugin: sparkline. A sparkline is an inline graphic (http://www.edwardtufte.com/bboard/q-and-a-fetch-msg? msg_id=0001ORtopic_id=1). I borrowed the idea (and most of the code) from the TiddlyWiki project, a very good one-page wiki (http://www.tiddlywiki.com). Thanks to Jeremy Ruston for his work and his permission. Here is the link to the test page: http://fmarcia.info/jquery/sparkline/sparkline.html It's tested successfully on Windows XP with FF1.5.07, IE5.5, IE6, IE7RC1 and Opera 9.02. However, even if it works fine with FF on Linux, it doesn't behave correctly with Konqueror. I assume it's the same with Safari... As usual, any comment appreciated. Cheers, Franck. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] iUtil use it
A link would be terribly useful when promoting something this hard. :) Corey On Sep 30, 2006, at 9:39 AM, kenton.simpson wrote: Even if your not using the interface plugin you need down load the iUtil plugin and start using it. I even think that iUtil should go core. Thanks Stefan Petre -- View this message in context: http://www.nabble.com/iUtil-use-it- tf2362236.html#a6580883 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Hpricot (RE: Spread jQuery Request)
On Sep 28, 2006, at 9:44 AM, Michael Geary wrote: Yes. I see now. Unfortunately, as Klaus said, jQuery no longer has this edge as other developers have cottoned on to this. Why unfortunately? A great concept was invented here, and that's *very* fortunate. Thank you John, be proud :) Speaking of sincere flattery, has anyone seen Hpricot? It's an HTML parser and munger for Ruby that uses jQuery-style expressions: http://code.whytheluckystiff.net/hpricot/ I keep trying to get to a project where I intend to use it. Too bad _why hasn't applied his zany charm and prolific coding skills to creating a time machine. Corey ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery.browser and Safari
On Aug 31, 2006, at 5:40 PM, Klaus Hartl wrote: This is an interesting read regarding user agent spoofing (see point 9): http://webstandardsgroup.org/features/david-storey.cfm Interesting. Open the Web sounds kinda Grease Monkey-ish. Corey ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] jQuery.browser and Safari
Anybody else noticed that Safari is reported as Mozilla? script alert(jQuery.browser.safari + \n + jQuery.browser.mozilla) /script mozilla/5.0 (macintosh; u; intel mac os x; en) applewebkit/418.8 (khtml, like gecko) safari/419.3 true true Based on the code: var b = navigator.userAgent.toLowerCase(); ... mozilla: /mozilla/.test(b) !/compatible/.test(b) I presume that this is not intended and plan to fix it if no one objects. Also, is jQuery.browser intended for external consumption? Since there's no documentation I assume it's intended for internal consumption only. Maybe a rename to jQuery._browser would be appropriate? Corey ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Tests that crash Safari
Trial and error (and a lot of Saft recovering my tabs) indicates that these are the culprits: tests/10-jQuery.find.js: ... t( Checked UI Element, input:checked, [radio2,check1] ); ... t( Is Visible, input:visible, [text1,text2,radio1,radio2,check1,check2] ); t( Is Hidden, input:hidden, [hidden1,hidden2] ); Haven't had time to figure out what the actual issue is, but I'm guessing there's something funny about input objects in Safari. :) Corey ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery.browser and Safari
On Aug 31, 2006, at 5:34 PM, John Resig wrote: It is fairly common to spoof or manipulate a browser's user agent string. Woah... that's news to me! Especially considering that Safari and Opera combined have like 4% of the browser market. I looked at Opera 9 and it's not immediately apparent how to switch user agents (in that, I was looking for it, and I can't find it anywhere). Additionally, in Safari you must enable a debug menu on the command-line before you can even see the menu to change your user agent. I mean, it's something like this: Opera and Safari Browser Market Number of users who know what a user agent is Number of users who change their user agent The number of users who leave their user agent changed. Forgot to mention that you have to turn on the Debug menu in Safari using the command line to muck with the UA. I mean, I think I'd be generous saying that that's like 10 people -- in the world. I did it once, to use a particularly ornery site once. Did it for my wife once too. Does that make it 8 people? ;) Corey ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery vs Prototype
You'd be surprised at how much functionality jQuery packs into such a small package. I used to use prototype, but I've switched to jQuery completely. Maybe the largest piece of functionality you'll give up is access to some of the other stuff that leverages prototype (e.g. scriptaculous). However jQuery has a thriving plugin community that's rapidly expanding the quite of bolt-on goodness. My main reason for switching to jQuery is it's terseness and expressiveness. The chainable method strategy often results in being 50-75% shorter code than equivalent prototype code. There's some examples documenting this phenomena on the jQuery blog. For me terser, more expressive code is not only more productive, but more readable and easier to debug. Corey On Aug 16, 2006, at 12:51 PM, Menier, Todd wrote: Hello, I'm new to this mailing list and have recently begun the process of evaluating jQuery. After looking at a wide variety of Javascript/ Ajax libraries, I've narrowed my choices down to jQuery and Prototype. Though I understand there's nothing stopping me from using both, there's lots of overlapping functionality from what I can tell and I'd prefer to pick one as my primary solution. I'm having a hard time finding good information that directly compares the 2 libraries. I assume the in exchange for the much smaller file size, I'd be giving up a good deal of functionality by going with jQuery. I've begun going through what documentation and articles do exist in an attempt to put my own comparison together, but I was wondering if anyone who has experience with both libraries could provide a broad overview of their main differences? Thanks! Todd ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/