Re: [jQuery] Manually loading Chili
Hi Scott. Your request is very interesting: I'm going to add that feature to the next release of Chili. Meanwhile, if you feel confident with javascript, you could expose the function 'makeDish', which is now inside a closure. You could then use it directly on the element to highlight. In a static setup you could write: makeDish( $( '#myPHPSnippet' )[0], ChiliBook.recipes[ 'php.js' ] ); I hope this helps, Andrea Scott Sauyet-3 wrote: > > If this is not the right forum for discussing the Chili plug-in, I > apologize. (And would love a pointer to the right place.) > > I'm quite new to JQuery and am trying my first project with it. It > involves some syntax highlighting, so I was trying to use Chili. But I > can't find a way to trigger Chili manually. It looks as though it runs > only at load time. Unfortunately, the code I want to highlight is > loaded through an Ajax call and is not available when the document is > ready. > > Does anyone know how I can trigger Chili to run on a particular element > after the page has been loaded? > > Thanks for any help you can offer. > >-- Scott Sauyet > > > ___ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > > -- View this message in context: http://www.nabble.com/Manually-loading-Chili-tf3382498.html#a9664313 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] metadata by means of metaobjects
I just got to version 1.3 thanks to the feedback generated by this thread. Daniel Wachsstock sent me his shorter version, which I could easily integrate. I fixed some bugs (he cut too much), but it's ok now. I updated the Metaobjects manual with your words, John :-) I must admit that I didn't get that as clear as you just explained. John Resig wrote: > > The "problem" is that it's a fundamentally different way of dealing > with Metadata. Metaobjects is much more pro-active, whereas the > Metadata plugin is passive in nature. That's not a bad thing, it's > just different. > > For example, with the Metaobjects plugin you can setup rules to have > data bound to certain selectors, whereas in the Metadata plugin you > can only attach JSON-formatted data to individual elements. > > And just to reply to one point on the Metaobjects site: "The 'element > content' method is easily used with a SCRIPT element, because its > content stays automatically hidden, but it can clash with your regular > scripts." That is incorrect. You're supposed to use a script tag with > a type of "application/json" - the official mimetype for JSON data. > Browsers ignore script tags that completely, it is not executed in any > way. > > It is true that the element is not cleaned up after itself, but that > should be remedied - and it's an easy fix. > > The / style syntax could be included straight into the > Metadata plugin, but I wouldn't want to undermine how the Metaobjects > plugin works (while, at the same time, not providing the exact > capabilities of the Metaobject plugin). > > With that being said - it's up to Andrea, while Metaobjects certainly > won't replace the Metadata plugin, they could certainly be merged - it > would simply require a little more work, but it may be worth it. > > It should also be noted that the Metaobjects plugin is, fundamentally, > faster than the Metadata plugin as it can quickly search through a DOM > structure for a specific pattern, rather than trying to load the > information on the fly. (Granted this technique could be introduced > into the Metadata plugin for the 'elem' style of Metadata, but I'd > hate to duplicate efforts in this matter.) > > --John > > On 3/1/07, Erik Beeson <[EMAIL PROTECTED]> wrote: >> I'm curious to hear other people's thoughts on this approach. If it's >> a sound idea, why isn't it part of the official metadata plugin? >> >> --Erik >> >> >> On 3/1/07, Andrea Ercolino <[EMAIL PROTECTED]> wrote: >> > >> > I was wondering if anyone is using my >> > http://www.mondotondo.com/aercolino/noteslog/?page_id=105 Metaobjects >> plugin >> > as a replacement for the metadata plugin. >> > >> > It's now at version 1.2 and I'm really proud of this simple tool. >> > >> > The best features of Metaobjects are: >> > -- valid XHTML mark-up >> > -- auto clean up by default >> > -- attach data to properties of dom elements directly >> > -- add any writable property or a brand new one >> > -- each value is evaluated and then the result is assigned >> > -- data can be any javascript expression: function declarations and >> calls >> > too >> > -- each metaobject can be further customized by a metaparam >> > -- target is metaobject's parent by default, but can be changed to any >> > jquery selector (sort of one metaobject to rule them all ;-) >> > -- default behavior is customizable >> > -- user decides what metaobjects are processed and when to do it >> > >> > >> > -- >> > View this message in context: >> http://www.nabble.com/metadata-by-means-of-metaobjects-tf3327825.html#a9252509 >> > 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/ > > -- View this message in context: http://www.nabble.com/metadata-by-means-of-metaobjects-tf3327825.html#a9275732 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Path problem with Imagebox
I don't know... are you sure you replaced the square brackets? Janet Weber wrote: > > Hi Andrea > > I tried that, but I get an error message when I modify the index.php of > the > plugin. It says there is a T_string error in the type="text/javascript"> line. > > Janet > > -Original Message- > From: [EMAIL PROTECTED] [<a rel="nofollow" href="mailto:[EMAIL">mailto:[EMAIL</a> PROTECTED] > Behalf Of Andrea Ercolino > Sent: Thursday, March 01, 2007 12:10 PM > To: discuss@jquery.com > Subject: Re: [jQuery] Path problem with Imagebox > > > > Sorry, disregard my previous message. > > Here is what you need: > > <script type="text/javascript"> > $(document).ready( > function() > { > $.ImageBox.init( > { > loaderSRC: 'images/imagebox/loading.gif', > closeHTML: '[img > src="images/imagebox/close.jpg" /]' > } > ); > } > ); > > This snippet appears inside the imagebox example. You sholud put it also > inside your page, with the two paths properly configured. Maybe you need > to > use different relative paths. You could try by using an absolute path at > first, to see that it works, and then try to deg a relative path from > there. > > Also please note that I had to use a trick in the snippet above for > posting > it here: I replaced the angle brackets in closeHTML with square ones, just > put them back in :-) or copy that snippet from > http://interface.eyecon.ro/demos/imagebox.html > > --Andrea > > > Janet Weber wrote: >> >> Hi >> >> I use Joomla and it is installed in the root of my website. hence I don't >> use a \Joomla directory. >> >> I can't get ImageBox the work right in this configuration. When the box >> opens it doesn't display the loading graphic and when the box is open is >> doesn't display the close button at all. >> >> I have install the same plug-in in my test system where Joomla is install >> in >> the /joomla directory and imagebox works fine. >> >> How do I fix this problem? >> >> Thank you >> >> Janet Weber >> >> >> ___ >> jQuery mailing list >> discuss@jquery.com >> http://jquery.com/discuss/ >> >> > > -- > View this message in context: > http://www.nabble.com/Path-problem-with-Imagebox-tf3328033.html#a9253797 > 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/ > > -- View this message in context: http://www.nabble.com/Path-problem-with-Imagebox-tf3328033.html#a9254297 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Path problem with Imagebox
Sorry, disregard my previous message. Here is what you need: $(document).ready( function() { $.ImageBox.init( { loaderSRC: 'images/imagebox/loading.gif', closeHTML: '[img src="images/imagebox/close.jpg" /]' } ); } ); This snippet appears inside the imagebox example. You sholud put it also inside your page, with the two paths properly configured. Maybe you need to use different relative paths. You could try by using an absolute path at first, to see that it works, and then try to deg a relative path from there. Also please note that I had to use a trick in the snippet above for posting it here: I replaced the angle brackets in closeHTML with square ones, just put them back in :-) or copy that snippet from http://interface.eyecon.ro/demos/imagebox.html --Andrea Janet Weber wrote: > > Hi > > I use Joomla and it is installed in the root of my website. hence I don't > use a \Joomla directory. > > I can't get ImageBox the work right in this configuration. When the box > opens it doesn't display the loading graphic and when the box is open is > doesn't display the close button at all. > > I have install the same plug-in in my test system where Joomla is install > in > the /joomla directory and imagebox works fine. > > How do I fix this problem? > > Thank you > > Janet Weber > > > ___ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > > -- View this message in context: http://www.nabble.com/Path-problem-with-Imagebox-tf3328033.html#a9253797 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Path problem with Imagebox
Hi Janet. I didn't use ImageBox ever, but the docs here: http://interface.eyecon.ro/docs/imagebox give two options that I think refer exactly to your issue: textImage - String - mandatory - when a galalry it is build then the iteration is displayed textImageFrom - String - mandatory - when a galalry it is build then the iteration is displayed --Andrea Janet Weber wrote: > > Hi > > I use Joomla and it is installed in the root of my website. hence I don't > use a \Joomla directory. > > I can't get ImageBox the work right in this configuration. When the box > opens it doesn't display the loading graphic and when the box is open is > doesn't display the close button at all. > > I have install the same plug-in in my test system where Joomla is install > in > the /joomla directory and imagebox works fine. > > How do I fix this problem? > > Thank you > > Janet Weber > > > ___ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > > -- View this message in context: http://www.nabble.com/Path-problem-with-Imagebox-tf3328033.html#a9253523 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Question about binding .click() (and other events) to parentless elements
Quite expected behavior :-) You should always use jQuery( htmlSnippet ) and attach it to the dom as soon as possible. This also works fine, and is a typical chain: var removeLink = $(" # Remove ") .appendTo( ".portlet .handle" ) .click( function() { alert( 'hello' ); } ); --Andrea Weaver, Scott-2 wrote: > > I noticed somewhat odd behavior when using .click() on newly created > elements. If the .click() is assigned prior to the element being > attached to the DOM, the element behaves as if there is no event bound > to it. > > var removeLink = $(" # Remove ").click(function() > {alert('hello');}); > $(".portlet .handle").append(removeLink); > > Tested this in both FF 1.5 and IE6 and the event appears to have never > been bound to the element. > > However, this works fine: > > var removeLink = $(" # Remove "); > $(".portlet .handle").append(removeLink); > $(".portlet .handle a").click(function() {alert('hello');});; > > Is this expected behavior? It is not a big deal at all though it did > cost me a bit of time earlier this morning try to figure why things > weren't working. If this is expected behavior a short note/warning in > event docs would be nice :) > > Regards, > -scott > > ___ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > > -- View this message in context: http://www.nabble.com/Question-about-binding-.click%28%29-%28and-other-events%29-to-parentless-elements-tf3327728.html#a9253176 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] metadata by means of metaobjects
I was wondering if anyone is using my http://www.mondotondo.com/aercolino/noteslog/?page_id=105 Metaobjects plugin as a replacement for the metadata plugin. It's now at version 1.2 and I'm really proud of this simple tool. The best features of Metaobjects are: -- valid XHTML mark-up -- auto clean up by default -- attach data to properties of dom elements directly -- add any writable property or a brand new one -- each value is evaluated and then the result is assigned -- data can be any javascript expression: function declarations and calls too -- each metaobject can be further customized by a metaparam -- target is metaobject's parent by default, but can be changed to any jquery selector (sort of one metaobject to rule them all ;-) -- default behavior is customizable -- user decides what metaobjects are processed and when to do it -- View this message in context: http://www.nabble.com/metadata-by-means-of-metaobjects-tf3327825.html#a9252509 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] dynamic loading of jquery.js into my web page
Christof Donat wrote: > > Maybe it has to do with your security-setings in IE. You need to allow > scripts > to access "secure" ActiveX-Controls, as you need for all ajax stuff. > Otherwise there will of course not be any chance to get an XMLHttpRequest > object. > But that cannot be the case because I tested your page and it worked... so my IE security-settings must be OK for jsPAX. Could you please confirm that the page you see in FF and IE both show colored code? You'll begin to think I'm pedant, but in FF I see colored code, no matter if I reload. On the contrary, in IE7 I can see at first black code, and after a reload the page disappears and the progress bar keeps loading, and loading, and loading... (it never stops) I've put a test page here: http://www.mondotondo.com/test/chili/test-jspax.html -- View this message in context: http://www.nabble.com/dynamic-loading-of-jquery.js-into-my-web-page-tf2905089.html#a8417084 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] dynamic loading of jquery.js into my web page
Christof Donat wrote: > > I have no problems with a relative package path > This is very strange... Did you use the exact files/directories in the zip I submitted? -- View this message in context: http://www.nabble.com/dynamic-loading-of-jquery.js-into-my-web-page-tf2905089.html#a8392903 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] dynamic loading of jquery.js into my web page
Christof Donat wrote: > > @Andrea: can you please check, if that was the problem for you? > Your test page works now :-) But I still have the same problem... Here is a zip file. After unzipping, there will be a new "chili" folder with a test page and a subfolder. It works in FF1.5.0.9 but does not in IE7. http://www.nabble.com/file/5620/chili.zip chili.zip -- View this message in context: http://www.nabble.com/dynamic-loading-of-jquery.js-into-my-web-page-tf2905089.html#a8313016 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] dynamic loading of jquery.js into my web page
Christof Donat wrote: > >> Which testsuite? What URL? > > Look at > http://www.jspax.org/test/ > FF, OK. IE, KO: http://www.nabble.com/file/5605/jspax.png -- View this message in context: http://www.nabble.com/dynamic-loading-of-jquery.js-into-my-web-page-tf2905089.html#a8296718 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] dynamic loading of jquery.js into my web page
Christof Donat wrote: > > Hm, that is strange. can you please check, if the testsuite at jquery.org > works correctly with IE for you? It uses exactly the compressed package.js > that is also available for download. > Which testsuite? What URL? -- View this message in context: http://www.nabble.com/dynamic-loading-of-jquery.js-into-my-web-page-tf2905089.html#a8296217 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] dynamic loading of jquery.js into my web page
Christof Donat wrote: > > Just a guess: Have you tried to use an absolute URL, or at leas an > absolute > path here? Maybe Firefox interprets that relative to the current HTML page > and IE interprets it relative to the js. Then IE tries to > load "packages/packages/jquery.js" where Firefox loads > "packages/jquery.js". > I've tried again with an absolute path "/test/1.5/examples/4/packages/" and an absolute url "http://localhost/test/1.5/examples/4/packages/";, but still nothing changes: FF OK, IE KO. -- View this message in context: http://www.nabble.com/dynamic-loading-of-jquery.js-into-my-web-page-tf2905089.html#a8295561 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] dynamic loading of jquery.js into my web page
1. I've put this line at the bottom of the standard jquery.js file not compressed: $package('jquery',{}); 2. I've wrapped the content of the standard chili.js file inside this: $using( 'jquery', function() { ... } ); 3. I've changed the default path inside package.js to: $package.packageBase = 'packages/'; 4. I've added this markup to mypage.html: 5. I've put the modified chili.js and jquery.js files inside the 'packages' folder, so the folder from where the page is loaded contains: mypage.html, package.js, packages/ 6. It works in FF, but it does not in IE. -- View this message in context: http://www.nabble.com/dynamic-loading-of-jquery.js-into-my-web-page-tf2905089.html#a8289335 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] dynamic loading of jquery.js into my web page
Christof Donat wrote: > >> Yes, I downloaded it short before. >> Please, tell me when I can download the fixed version, and I'll test >> again > I just have uploaded the current version again. Please try again. > I've just downloaded and tried again but... nothing changed :( -- View this message in context: http://www.nabble.com/dynamic-loading-of-jquery.js-into-my-web-page-tf2905089.html#a8243235 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] dynamic loading of jquery.js into my web page
Christof Donat wrote: > >> > Well, I don't know about any guarantees, but it works in all test I did >> > (with >> > the loaded script delayed, etc.) >> >> I'm trying to apply your jsPAX to my Chili setup, but it works in FF1.5 >> and >> not in IE7, which does not return any error and does not show the page, >> just keeps loading indefinitely. > > Have you just downloaded that version? The problem is, that IE7 has a > XMLHttpRequest Object that does not need ActiveX, but doesn't work like > the > one of Firefox, Safari, Konqueror and Opera. In the current version I used > the ActiveX-XMLHttpRequest every time ActiveX is available - which at > least > works as expected. > > If you just have downloaded it, I put the wrong version online. > Yes, I downloaded it short before. Please, tell me when I can download the fixed version, and I'll test again :-) -- View this message in context: http://www.nabble.com/dynamic-loading-of-jquery.js-into-my-web-page-tf2905089.html#a8189949 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] dynamic loading of jquery.js into my web page
Christof Donat wrote: > > Well, I don't know about any guarantees, but it works in all test I did > (with > the loaded script delayed, etc.) > Hi Christof. I'm trying to apply your jsPAX to my Chili setup, but it works in FF1.5 and not in IE7, which does not return any error and does not show the page, just keeps loading indefinitely. Andrea -- View this message in context: http://www.nabble.com/dynamic-loading-of-jquery.js-into-my-web-page-tf2905089.html#a8177701 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Lost
There are two things that I posted here a lot of time ago, but with little to no feedback at all. Well, they are not simple things actually. They hide hours of work and your comments do are a reward. I'll be glad to receive any kind of comments, everything in the range from "I love it" to "I hate you" :-) but please write a couple of words! Am I getting paranoid or is this usual in a discussion list? I don't know, I'm at my first experience in such a thing. I also thought I could have been doing something wrong. Maybe I used rude words or evil sentences, or I didn't do something that I had to. Please put me back on the right path. Thanks. 2006-10-17 (posted again on 2006-11-21) http://jquery.com/discuss/2006-November/017714/ 2006-11-28 http://jquery.com/discuss/2006-November/018337/ -- View this message in context: http://www.nabble.com/Lost-tf2774303.html#a7738911 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery enhancements
Jörn Zaefferer wrote: > > Would be a great help to have some more comments of some of those. > Homework done. :-) -- View this message in context: http://www.nabble.com/jQuery-enhancements-tf2727722.html#a7612654 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] filter refactored with the engine of Chili
Christof Donat wrote: > > You can not be shure that a JavaScript Engine is not threaded. This code > is > not threadsave. Imagine the following situation: > > Thread 1Thread 2 > $.filter() > parse2RE is set to e.g. 1 > Thread is stopped by OS Sceduler -> $.filter() > jQuery.parse2RE != 0 !! > Yes, but if it's not 0 it's ok I guess. There is a preprocessing step that sets parse2RE, and if it's not 0 isn't it safe to suppose it holds the correct RegExp object set during preprocessing? -- View this message in context: http://www.nabble.com/filter-refactored-with-the-engine-of-Chili-tf2718426.html#a7584966 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] .filter(array) bug, and patch
Fil wrote: > > I agree, but it's really grep that we want to do here, in my opinion. > The call to filter inside the loop is already grepping... ultimately. BTW: could someone explain how does it work this mechanism, where a function has two declarations, like filter, and each is properly called? How are they differentiated? -- View this message in context: http://www.nabble.com/.filter%28array%29-bug%2C-and-patch-tf2718768.html#a7583743 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] filter refactored with the engine of Chili
http://jquery.com/dev/bugs/bug/447/ -- View this message in context: http://www.nabble.com/filter-refactored-with-the-engine-of-Chili-tf2718426.html#a7583601 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] .filter(array) bug, and patch
the fix is much simpler: t.constructor == Array && jQuery.map(this,function(a){ for ( var i = 0; i < t.length; i++ ) if ( jQuery.filter(t[i],[a]).r.length ) return a; - return false; + return null; }) || I've tested with coreTest.js and your example and it works. -- View this message in context: http://www.nabble.com/.filter%28array%29-bug%2C-and-patch-tf2718768.html#a7582383 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] filter refactored with the engine of Chili
Hi there. I've refactored the "filter" core function of jQuery, merging my Chili parser into it. Now it should be cleaner, faster and tighter (I hope so) I passed it through coreTest.js, and all is fine for these browsers: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727) Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.8.0.8) Gecko/20061025 Firefox/1.5.0.8 Based on $Rev: 501, which measured 19016/53077 bytes, the new jQuery measures 20471/57966 bytes Do you think it could be used in production? Andrea Main changes: * a changed parsing engine where only 1 regexp match is executed on any call (there were some more) * a new preprocessing phase which builds one regexp out of the configuration object (calculated only on the first call, and cached for later use) * a changed configuration object (there were 2), which holds the regular expressions together with their relative checks on the elements * a tighter grammar, easier to maintain and augment * comments, meaningful names, patterns Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail beta. http://new.mail.yahoo.com/* Author: Andrea Ercolino ([EMAIL PROTECTED]) Date: 2006-11-28 ... FILTER REFACTORING --- I've refactored the "filter" core function of jQuery, merging my Chili parser into it. Now it should be cleaner, faster and tighter. I passed it through coreTest.js, and all is fine. * Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727) * Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.8.0.8) Gecko/20061025 Firefox/1.5.0.8 Based on $Rev: 501, which measured 19016/53077 bytes, the new jQuery measures 20471/57966 bytes Main changes: --- * a changed parsing engine where only 1 regexp match is executed on any call (there were 7?) * a new preprocessing phase which builds one regexp out of the configuration object (is executed only on the first call, and is cached for later use) * a changed configuration object (there were 2), which holds the regular expressions together with relative checks on the elements * a tighter grammar, preserving its ease of definition * comments, meaningful names, patterns Details: --- * I've renamed almost all of the local variables. Here is a side by side list. Inside the parentheses on the left I put the type and use of those names. On the right side the parentheses highlight only differences, if any. t (parameter) -> target t (member returned) -> t r (parameter) -> result r (member returned) -> r g (function)-> grep jQuery.expr (object)-> (jQuery.expr is not used now: remove?) jQuery.parse (array)-> jQuery.parse2 (object) (jQuery.parse is not used now: remove?) p (ref to jQuery.parse) -> steps (ref to jQuery.parse2) re (regexp from p[i]) -> re (regexp from steps) i (iterator of p) -> i (iterator of steps) m (array of matches)-> matches f (string) -> check f (function)-> fnCheck * I've put all the configuration inside a new jQuery.parse2 object. I don't know if someone is using jQuery.parse for some reason elsewhere (plugins?): this is why I didn't use the same name. (just search and replace if you like) This object is a bit complex. At the first level, there is a list of properties, which I call steps. Steps are keyed with the same keys of the properties of the old expr object. Steps values are objects themselves. Each one has a string property keyed name, a string property keyed exp, and a string / object property keyed chk. * The name is a synonym for the key of the step: I've introduced it to make the code more self-documented. * The exp is the value of the old parse array relative to that name. * The chk is the value of the old expr object relative to that name. * I've changed the regexps. * the anc
Re: [jQuery] jQuery 1.1 API improvements (macros, events)
dave.methvin wrote: > > Then there is the classic ambiguity of .unload(). Does it call an onunload > handler, or does it unbind all onload handlers? There is no doubt with > .un("load") or .on("unload", fn) which are only a few characters longer. > OK. But I don't think that "on" and "un" are better names than "bind" and "unbind", the former are shorter but the latter mean exactly what they say, no explication necessary. Let's summarize. Having fn = function() {...} this is the old verbose style enhanced $( "div" ).bind( "click", fn, {count: 1} ).trigger( "click", {bubble: true} ).unbind( "click", fn ); this is the almost (except for trigger) brand new style $( "div" ).on( "click", fn, {count: 1} ).trigger( "click", {bubble: true} ).un( "click", fn ); this is the old shortcut style enhanced and revisited $( "div" ).click( fn, {count: 1} ).click( {bubble: true} ).click( 0, fn ); Just a little thing: a prefix like "e_" would come in handy in at least two occasions. (1) a text search in a script: searching for ".e_" hops from each event handling snippet to the next (2) the functions index in the API documentation, for grouping event supporting functions together $( "div" ).e_click( fn, {count: 1} ).e_click( {bubble: true} ).e_click( 0, fn ); And what about this :)) ? It is almost what we already have and makes it possible to tune the search... ;-) $( "div" ).e_onClick( fn, {count: 1} ).e_doClick( {bubble: true} ).e_unClick( fn ); $( "div" ).e_onLoad( fn, whatever ).e_doLoad( whatever ).e_unLoad( fn ); $( "div" ).e_onUnload( fn, whatever ).e_doUnload( whatever ).e_unUnload( fn ); enough brainstorming -- View this message in context: http://www.nabble.com/jQuery-1.1-API-improvements-%28macros%2C-events%29-tf2713203.html#a7570741 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery 1.1 API improvements (macros, events)
Jörn Zaefferer wrote: > > So far bind() would be on() and unbind() would be un(). The shortcuts > would be removed from the default distribution, but still available as a > compatibility plugin. > Don't remove the shortcuts, please! They are very convenient for the events. I can understand that css() and attr() can be enough. But click() as it is now is Easy and Clear and Convenient. The unbind could be incorporated into click() too, for example by using click( null ); http://www.nabble.com/jQuery-API-discussion-tf2463514.html#a6867849 as I suggested before . Jörn Zaefferer wrote: > > How about this: > var handler = function() { ... }; > $("div").bind("click", handler, {amount: 1}); > OK, it won't be so different after all, having the options at the bottom. Jörn Zaefferer wrote: > > But the empty object would be still be passed around, creating > unncessary overhead. The "default" is nothing, therefore you should at > least use null as the second argument. Still I don't like an API that > forces me to pass null around all the time. > OK I've already given up on this. Anyway the default is not "nothing", I think it's "{amount: infinity}" for events. -- View this message in context: http://www.nabble.com/jQuery-1.1-API-improvements-%28macros%2C-events%29-tf2713203.html#a7566749 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery 1.1 API improvements (macros, events)
Jörn Zaefferer wrote: > > ... > The big so far unsolved question: What should the API methods look like? > How to pass the additional data to the event handler? > > Currently I favor an interface that looks like this: > $().bind("type of event", eventHandler, {amount: 5, data: > additionalStuff}) > $().trigger("type of event", {bubble: true, data: moreStuff}); > ... > Your opinions? > I hope the event shortcuts will remain, like click( handler ) to bind and click() to trigger. As for the bind style, I think the handler should always be the last argument, because to me it's cleaner this: $( "div" ).bind( "click", {amount: 1}, function() { doClick(); } ); than this: $( "div" ).bind( "click", function() { doClick(); }, {amount: 1} ); Sure having the function at the bottom makes optional arguments a little more complitated, and if you think it's better to avoid all those type checking in the code (I think the same) then the solution is to have no optional arguments at all, like this: $( "div" ).bind( "click", {}, function() { doClick(); } ); This style adds a bit of self-documentation to the script, making it clear that we are using default values for the second argument. -- View this message in context: http://www.nabble.com/jQuery-1.1-API-improvements-%28macros%2C-events%29-tf2713203.html#a7565490 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Working on a getScripts plugin
Christof Donat wrote: > >> In another thread >> (getScript error), we were discussing alternatives because it seems not >> to >> work as expected, at least for a delay of 0 milliseconds. > > Are you talking about this thread? > > http://www.nabble.com/eval.call(-window,jscode)-does-not-work-in-IE-tf2202851.html#a6099563 > > The solution with window.evalScript() looks good. I changed my code > accordingly. I also have set up a simple testsuite. Anyone interested may > test package.js now in his prefered browser. I hope that everything still > works. Currently I don't have an IE at hand. If anyone of you could try > that > It would be of much help. > Hi Christof. The thread I was referring to is this one: http://www.nabble.com/getScript-error-tf2652417.html One of my last messages (http://www.nabble.com/forum/ViewPost.jtp?post=7508366&framed=y) gave the results of a full test of eval.call and setTimeout( script, 0), showing that the latter works very badly. -- View this message in context: http://www.nabble.com/Working-on-a-getScripts-plugin-tf2696465.html#a7545996 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Working on a getScripts plugin
Christof Donat wrote: > > I don't use jQuery in jsPax, because I load jQuery as a jsPax-package > It's just what I'm interested in. An independent script to add to a page and have it load what is needed: nice shot Christof! I've looked at your package.js, and I've found that you use the setTimeout method for evaluating the loaded script in the global scope, with a delay of 1 millisecond. Don't you have any problems with that? In another thread (getScript error), we were discussing alternatives because it seems not to work as expected, at least for a delay of 0 milliseconds. -- View this message in context: http://www.nabble.com/Working-on-a-getScripts-plugin-tf2696465.html#a7529000 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Working on a getScripts plugin
Christof Donat wrote: > > No. In your example b.js is completelly evaluated before the doA() is > called, > but that only means, that the download of c.js has been started. As soon > as > that has finished, doB() is called, but that can be after doA() has been > called. > > $.getScript() initiates the download and takes care that the callback is > called after the download will have finished and then immediatelly > returns. > Some time later the download actually has finished and then the script is > evaluated and the callback is called. > > The result for your example is: > > a.js: $.getScript('b.js',doA); > - b.js begins to load > a.js has finished > - b.js is completely loaded > b.js is evaluated -> > $.getScript('c.js',doB); > - c.js begins to load > b.js has finished -> doA() is called > - c.js is completely loaded > c.js is evaluated -> doC(); > c.js has finished -> doB() is called > > As you see the order will be doA(), doC(), doB(). > Wow! This is a good explanation! I undestand now, thank you Christof! So, if I want getScripts to wait until all is loaded and evaluated at all levels before going on, I cannot use this method, as you noted before. I think that this facility (being able to load many scripts without declaring them in the html) will make jQuery easier to use. An alternative could be to inspect any loaded script and see if it requires more scripts (recursively). If it does (like b.js), then I could find a way to transform [a.js// $.getScript( "b.js", function() { doA(); } ); ][b.js// $.getScript( "c.js", function() { doB(); } ); ] into [a.js// $.getScript( "c.js", function() { doB(); doA(); } ); ]. And condidering that I'm not interested in providing this functionality in the wild, but only for jQuery plugins, I could enforce a standard format where any script declares the scripts it requires at the beginning. Another alternative could be to have a little module on the server. A script does a normal getScript with an url like [ /make/?a.js ] and the make module buids a file with all the needed parts, then packs and serves it. -- View this message in context: http://www.nabble.com/Working-on-a-getScripts-plugin-tf2696465.html#a7527956 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Working on a getScripts plugin
Christof Donat wrote: > > No, the order could be doA() doC() doB(). That is because doA() is called > as > soon as b.js is loaded but before c.js is loaded. The call to > $.getScript() > in b.js returns immediatelly and loads c.js assynchonously. Then b.js is > finished and doA() is called while c.js is still loading. > $.getScript works this way: download, evaluate, callback, finish. Are you saying that the callback call occurs before evaluate has ended? Well, that the evaluation of b.js ends before c.js is loaded? -- View this message in context: http://www.nabble.com/Working-on-a-getScripts-plugin-tf2696465.html#a7526579 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Working on a getScripts plugin
Christof Donat wrote: > > That does not help, if your loaded script needs to load another script. > For example: file "a.js" is [ $.getScript( "b.js", function() { doA(); } ); ] file "b.js" is [ $.getScript( "c.js", function() { doB(); } ); ] file "c.js" is [ doC(); ] the page has: [ script src=jquery.js - script src=a.js ] You say that the order could be: doB(); doC(); doA(); instead of: doC(); doB(); doA(). Or also that doA() could happen before the end? -- View this message in context: http://www.nabble.com/Working-on-a-getScripts-plugin-tf2696465.html#a7526045 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Working on a getScripts plugin
Christof Donat wrote: > > $.getScript() is assynchonous. That means, that it returns before the > script > is loaded. > Yes, but if I put all my code into the callback? -- View this message in context: http://www.nabble.com/Working-on-a-getScripts-plugin-tf2696465.html#a7524534 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Working on a getScripts plugin
Christof Donat wrote: > > You can have that a lot cheaper. How about this: > > jQuery.getScripts = function(scripts,callback) { > if( scripts.length == 0 ) { > callback(); > return; > } > jQuery.getScript(scripts[0],function() { > jQuery.getScripts(scripts.slice(1),callback); > }); > } > Ah recursion, what a beautiful thing! I like it. But I don't understand the drawback. If the loaded scripts are evaluated as soon as they are loaded, before calling the callback in $.getScript AFAIK, there should be no problem, except that getScript does not support library registration, so there is a risk for looping indefinitely. -- View this message in context: http://www.nabble.com/Working-on-a-getScripts-plugin-tf2696465.html#a7520846 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Working on a getScripts plugin
To restore tabs, see this message from http://www.nabble.com/Working-on-a-getScripts-plugin-tf2696465.html -- View this message in context: http://www.nabble.com/Working-on-a-getScripts-plugin-tf2696465.html#a7519622 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Working on a getScripts plugin
Some days ago I wrote this getScripts plugin, as a macro for shrinking this $.getScript( "f1.js", function() { $.getScript( "f2.js", function() { $.getScript( "f3.js", function() { do_it(); } ); } ); } ); to this $.getScripts( [ "f1.js", "f2.js", "f3.js" ], function( ) { do_it(); } ); I was wondering if I'm doing the right thing when converting the callback to a string. What do you think? jQuery.extend({ getScripts: function( files, callback ) { if( files.length && files[0] ) { var template = ['jQuery.getScript( "','','", function() {','','} );'] , templateLast = ['jQuery.getScript( "','','", ','',' );'] , FILE = 1, BODY = 3 ; var stack = files.concat(); templateLast[FILE] = stack.pop(); templateLast[BODY] = callback.toString(); var code = templateLast.join( "" ); while( stack.length ) { var top = stack.pop(); if( "" == top ) continue; template[FILE] = top; template[BODY] = code; code = template.join( "" ); } jQuery.globalEval( code ); } } }); -- View this message in context: http://www.nabble.com/Working-on-a-getScripts-plugin-tf2696465.html#a7519511 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery.parse[1]
Andrea Ercolino wrote: > > There is a little bug in jQuery.parse[1]: the white space shortcut is not > escaped by an additional backslash. > Reported in this ticket: http://jquery.com/dev/bugs/bug/429/ -- View this message in context: http://www.nabble.com/jQuery.parse-1--tf2694789.html#a7519275 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] getScript error
Michael Geary wrote: > >require( 'test.js', function() { > // This code runs when the script is loaded >}); > jQuery already had the $.getScript function to use the same way as the require in your example above. And this is the reason we are trying to have it work properly in this thread. -- View this message in context: http://www.nabble.com/getScript-error-tf2652417.html#a7519037 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery.parse[1]
I've found the button... I'm going to add the report right now :-) -- View this message in context: http://www.nabble.com/jQuery.parse-1--tf2694789.html#a7515601 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery.parse[1]
Jörn Zaefferer wrote: > > Could you please post that as a bug report? Thanks. > Where is the button? This message links to an empty page: Note: See TracReports for help on using and creating reports -- View this message in context: http://www.nabble.com/jQuery.parse-1--tf2694789.html#a7515456 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] getScript error
Jörn Zaefferer wrote: > > Looks good for me. > I have browsed dojo and prototype today, but they seem to do nothing special for eval, ie: I think that they share the same problem, but are unaware of it. -- View this message in context: http://www.nabble.com/getScript-error-tf2652417.html#a7515295 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] jQuery.parse[1]
There is a little bug in jQuery.parse[1]: the white space shortcut is not escaped by an additional backslash. -- View this message in context: http://www.nabble.com/jQuery.parse-1--tf2694789.html#a7515200 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] getScript error
沈志川 (Benx) wrote: > > Why not use document.createElement("script") !? > Because we want jQuery to wait until the script is loaded and evaluated, so it's possible to do something upon completion, like continuing the normal flow of the program. This is necessary for example for writing a require like the one in PHP. -- View this message in context: http://www.nabble.com/getScript-error-tf2652417.html#a7514393 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] getScript error
Karl Rudd wrote: > > // window.setTimeout(s,0); // blah() fails in all > Karl Rudd > This is very surprising. I tested the setTimeout before posting Jeff's installScript to this thread, and I found that it worked. But my test was inappropriate, because I wanted it to succeed with my getScript issue, while you wanted it to fail in general and your attitude is much better than mine, for testing something. So this is just to confirm that your claiming about setTimeout is correct. Here are the results of my new testing session, using a case very similar to yours: The setTimeout works never in Opera, and some times does, other does not in Firefox. Here are the details: fresh cache % is subjective IE + head call: 1st alert: good - 2nd alert: good IE + body call: 1st alert: good - 2nd alert: good FF + head call + eval.call: 1st alert: good - 2nd alert: good FF + body call + eval.call: 1st alert: good - 2nd alert: good Op + head call + eval.call: 1st alert: good - 2nd alert: good Op + body call + eval.call: 1st alert: good - 2nd alert: good FF + head call + setTimeout + go: 1st alert: bad - 2nd alert: 90% bad FF + head call + setTimeout + refresh: 1st alert: bad - 2nd alert: 60% bad FF + body call + setTimeout + go: 1st alert: bad - 2nd alert: 60% bad FF + body call + setTimeout + refresh: 1st alert: bad - 2nd alert: 60% bad Op + head call + setTimeout:1st alert: bad - 2nd alert: bad Op + body call + setTimeout:1st alert: bad - 2nd alert: bad And here is the script used for testing: function jQuery_eval( script ) { if (!script) return; if (window.execScript) window.execScript( script ); else { eval.call( window, script ); // window.setTimeout( script, 0 ); } } var global = "not changed"; function hereScript( fn ) { var re = new RegExp( "function\\s*\\(\\s*\\)\\s*\\{((?:.|\\n)*)\\}", "g" ); return re.exec( fn )[1]; } var script = hereScript( function() { //- function blah2() { alert( "hello from blah2()" ); } global = "changed"; //- } ); //alert( script ); function test() { jQuery_eval( script ); alert( global ); try { blah2(); } catch( e ) { alert( e ); } } //test(); -- View this message in context: http://www.nabble.com/getScript-error-tf2652417.html#a7508366 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Breaking news from Dean Edwards site
Dean has devised a way for cloning global JavaScript objects, like Array, making it possible to subclass them without interfering with their standard instances in the current page. http://dean.edwards.name/weblog/2006/11/hooray/ Sponsored Link Online degrees - find the right program to advance your career. www.nextag.com___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] getScript error - Solved?
here they don't say much: --- http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/execscript.asp They don't even know if the second argument is required or optional... here they give an example for printing in IE4.x that uses execScript: --- http://msdn.microsoft.com/library/ja/default.asp?url=/library/ja/jpwebwk/author/script/code.asp I think that the installScript, if passes your quality tests, should be included in the core of jQuery, maybe renamed jQuery.eval Paul McLanahan wrote: > > Nice find Andrea! I never happened across that in my googling. Did you > find any info on what versions of IE support the execScript function? > -- View this message in context: http://www.nabble.com/getScript-error-tf2652417.html#a7420269 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] getScript error - Solved?
I've found a solution googling on "eval" which seems to work nicely. Check the updated test page: http://www.mondotondo.com/aercolino/punchcard/test-getScript-error/index.html Here is the magical function, by Jeff Watkins: /** Execute a script in the global context. This installs all functions defined in this script into the global scope, unless they are explicitly created in different scopes. @param script the source of the JavaScript to evaluate **/ function installScript( script ) { if (!script) return; // Internet Explorer has a funky execScript method that makes this easy if (window.execScript) window.execScript( script ); else window.setTimeout( script, 0 ); } John Resig wrote: > > I've created a trouble ticket for it here: > http://jquery.com/dev/bugs/bug/407/ > > --John > > On 11/17/06, Andrea Ercolino <[EMAIL PROTECTED]> wrote: >> >> Hi everybody. >> >> While developing the PunchCard widget I've found a problem with getScript >> in >> IE7. >> >> If you are interested in helping me, I've isolated the issue here: >> http://www.mondotondo.com/aercolino/punchcard/test-getScript-error/ >> >> Thanks >> Andrea > > ___ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > > -- View this message in context: http://www.nabble.com/getScript-error-tf2652417.html#a7417397 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] getScript error
OK, thanks Paul. -- View this message in context: http://www.nabble.com/getScript-error-tf2652417.html#a7413328 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] getScript error
I don't understand how to apply the workaround. It's fine to adjust the script which control the loading, and I think your last workaround say how to do it, but I don't understand it. Could you please reference my test code? Paul McLanahan wrote: > > As Norbert just pointed out in the thread "Dynamically Loaded Scripts > in IE 7 - Problems Found and Lessons Learned", it is a scope issue. > If the functions in your script file loaded via getScript use either > of the following two methods (they're synonymous) then the functions > will not be available in the global scope. > > function myFunc(){} > > var myFunc = function(){} > > However, if you define functions like this: > > myFunc = function(){} // note the lack of "var" > > Then it will be available and work fine. I've found no fix for this > in jQuery source. For now we just have to be careful of the scripts we > load in. > > You can also keep using the first method above and just define the > variable in the global scope earlier in the script file like so: > > myFunc = myOtherFunc = {}; > function myFunc(){} > etc... > > This was tested against SVN jQuery and IE7. > > On 11/17/06, Paul McLanahan <[EMAIL PROTECTED]> wrote: >> Found and patched the problem in ajax.js where $.getScript and >> $.getJSON don't do anything if a callback isn't supplied. The problem >> is that httpData function isn't called from $.ajax unless there is a >> callback supplied. Someone please commit if it's deemed a good fix. >> The only other fix is to add an else after the check for s.success in >> ajax.js on line 778 to look for types that need httpData to run. >> Something like >> >> // If a local callback was specified, fire it >> if ( s.success ) >> s.success( jQuery.httpData( xml, s.dataType ), status ); >> else if ( s.dataType=='script' || s.dataType=='json' ) >> jQuery.httpData( xml, s.dataType ); >> >> But I think the patch below might be easier... up to you committers. >> >> Index: ajax.js >> === >> --- ajax.js (revision 603) >> +++ ajax.js (working copy) >> @@ -420,11 +420,7 @@ >> * @cat AJAX >> */ >> getScript: function( url, callback ) { >> - if(callback) >> - jQuery.get(url, null, callback, "script"); >> - else { >> - jQuery.get(url, null, null, "script"); >> - } >> + jQuery.get(url, null, callback||function(){}, "script"); >> }, >> >> /** >> @@ -465,7 +461,7 @@ >> * @cat AJAX >> */ >> getJSON: function( url, data, callback ) { >> - jQuery.get(url, data, callback, "json"); >> + jQuery.get(url, data, callback||function(){}, "json"); >> }, >> >> /** >> >> >> I'm still looking for the IE7 problem. >> >> Paul >> >> >> On 11/17/06, John Resig <[EMAIL PROTECTED]> wrote: >> > I've created a trouble ticket for it here: >> > http://jquery.com/dev/bugs/bug/407/ >> > >> > --John >> > >> > On 11/17/06, Andrea Ercolino <[EMAIL PROTECTED]> wrote: >> > > >> > > Hi everybody. >> > > >> > > While developing the PunchCard widget I've found a problem with >> getScript in >> > > IE7. >> > > >> > > If you are interested in helping me, I've isolated the issue here: >> > > http://www.mondotondo.com/aercolino/punchcard/test-getScript-error/ >> > > >> > > Thanks >> > > Andrea >> > >> > ___ >> > jQuery mailing list >> > discuss@jquery.com >> > http://jquery.com/discuss/ >> > >> > > ___ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > > -- View this message in context: http://www.nabble.com/getScript-error-tf2652417.html#a7410144 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] getScript error
Hi everybody. While developing the PunchCard widget I've found a problem with getScript in IE7. If you are interested in helping me, I've isolated the issue here: http://www.mondotondo.com/aercolino/punchcard/test-getScript-error/ Thanks Andrea -- View this message in context: http://www.nabble.com/getScript-error-tf2652417.html#a7401479 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] API docs draft 2
same for me in FF1.5.0.8, while in IE7 it fliflifliflifliflickers a lot digital spaghetti wrote: > >> >> >> Jorn, I'm using FF2 and when I scroll down the left hand list, I get >> blue lines appearing across the frame, however they disappear when I >> go back up the list. They also disappear if I right-click on the >> frame as well. Seems to be some kind of refresh issue? >> >> > > Yep, I never noticed it the first time round - but the blue bar is > coming from the bottom of the frame off the scroll bar at the bottom. > However, it doesn't happen on the right hand frame. > > Tane > > ___ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > > -- View this message in context: http://www.nabble.com/API-docs-draft-2-tf2644321.html#a7393058 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] What tool is used to compress JQuery?
http://dean.edwards.name/packer/ howachen wrote: > > Hi all, > > May I know which tool is used to compress JQuery? > > I found this kind of tool is very useful and can use it? > > Thanks. > > ___ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > > -- View this message in context: http://www.nabble.com/What-tool-is-used-to-compress-JQuery--tf2619867.html#a7311246 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How do I add a js array of jquery objects to a jqueryobject?
mea culpa I made a 'mistake': I put in the loop an accessor $( ".class" ) that caused the abnormal delay. After saving the reference $class = $( ".class" ) before entering the loop, the delay has lowered to 78 milliseconds in IE7 AND 78 milliseconds in FF1.5.0.8: unbelievable! you can save references to your objects, making it very fast to get to those objects later Thanks Michael, "save references" was the key! It's only a pity that I had to dig in jQuery (Firebug) to find it out (I saw your post just before posting this "mea culpa") BTW: while digging I saw that the same jquery object gets through some code patterns many times, or at least it's what that looked to me. Also I was surprised seeing that array copying is done as "b = merge( a, [] )" in place of "b = a.concat();": shouldn't the latter be faster? Michael Geary wrote: > >> From: Andrea Ercolino >> >> I have got an array of 50 urls templates, and want to make a >> proper url out of each one, adding also a special click, and >> then append all these urls to a div in a specific position. >> All this should be done many times in a page, "many" could be >> 50, just to say something that could be possible, but it's >> really an unpredictable number of times. (well, less than a >> 100 is a good guess) >> >> I think the problem lies in the dom creation. >> Each link is inside 4 nested divs, so this could mean 80 >> bytes each (adding structure and data). >> At only 3 divs ( x 50 = 150 appends ) I'm experimenting a >> delay of a couple of seconds for reloading the page, and for >> this test the page has no content other than those divs! > > Yeah, all that DOM creation will take a while - especially if you use a > convenience plugin like mine. > > I get much better performance across browsers with [].join('') and > innerHTML. > > Here's a design pattern I use all the time. I threw in some arbitrary divs > and spans to show how the nesting works out. > > // Return HTML rendering for an array of strings > function renderAll( array ) { > var inner = []; > for( var i = 0, len = array.length; i < len; i++ ) { > inner[inner.length] = renderOne( array[i], i ); > } > > return [ > '', > '', > inner.join(''), > '', > '' > ].join(''); > } > > // Return HTML rendering for a string item > function renderOne( item, i ) { > return [ > '', > '', > item, > '', > '' > ].join(''); > } > > A test call could be: > > $('#testdiv').html( renderAll( [ 'one', 'two', 'three' ] ) ); > > This same basic pattern works for tables, or anything where you have > nested > and repeated elements. It works in just about any browser - even very old > ones, thanks to the use of inner[inner.length] instead of inner.push(). > And > it's very fast - much faster than the same DOM operations. > > Obviously you could replace the [].join('') with ordinary string > concatenation, but the array join is faster on most browsers. > > The one big drawback is that you don't automatically get references to the > objects you're creating. With DOM creation, you can save references to > your > objects, making it very fast to get to those objects later. To make up for > this, you can assign unique IDs in the HTML code as the example does. > > Obviously you could extend this all sorts of ways. In my actual code, the > "item" is usually an object and not a string, and the renderOne function > builds up HTML from that object's properties. > > -Mike > > > ___ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > > -- View this message in context: http://www.nabble.com/How-do-I-add-a-js-array-of-jquery-objects-to-a-jquery-object--tf2614381.html#a7310880 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How do I add a js array of jquery objects to a jqueryobject?
I just put a time start / end probes and found that each 50 times append loop eats up almost 500 milliseconds. Between 465 and 515 on IE7 and between 500 and 575 on FF1.5.0.8 This means that a page with 10 loops, needs 5 seconds to end displaying!! AND I was wrong before, each link is inside 2 divs, not 4. Andrea Ercolino wrote: > > I have got an array of 50 urls templates, and want to make a proper url > out of each one, adding also a special click, and then append all these > urls to a div in a specific position. All this should be done many times > in a page, "many" could be 50, just to say something that could be > possible, but it's really an unpredictable number of times. (well, less > than a 100 is a good guess) > > I think the problem lies in the dom creation. > Each link is inside 4 nested divs, so this could mean 80 bytes each > (adding structure and data). > At only 3 divs ( x 50 = 150 appends ) I'm experimenting a delay of a > couple of seconds for reloading the page, and for this test the page has > no content other than those divs! > > > dave.methvin wrote: >> >>> I've got a jquery script where I append (one by one) 50 new >>> jquery objects to another jquery object, but it's taking way >>> too much time, so I thought that it could be faster if I make >>> an array buffer out of them and then aggregate the array >>> as a whole, but I don't find out how to do it. >> >> Can you provide a little more detail about how you end up with 50 jQuery >> objects that you need to combine? >> >> >> ___ >> jQuery mailing list >> discuss@jquery.com >> http://jquery.com/discuss/ >> >> > > -- View this message in context: http://www.nabble.com/How-do-I-add-a-js-array-of-jquery-objects-to-a-jquery-object--tf2614381.html#a7309457 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How do I add a js array of jquery objects to a jqueryobject?
I have got an array of 50 urls templates, and want to make a proper url out of each one, adding also a special click, and then append all these urls to a div in a specific position. All this should be done many times in a page, "many" could be 50, just to say something that could be possible, but it's really an unpredictable number of times. (well, less than a 100 is a good guess) I think the problem lies in the dom creation. Each link is inside 4 nested divs, so this could mean 80 bytes each (adding structure and data). At only 3 divs ( x 50 = 150 appends ) I'm experimenting a delay of a couple of seconds for reloading the page, and for this test the page has no content other than those divs! dave.methvin wrote: > >> I've got a jquery script where I append (one by one) 50 new >> jquery objects to another jquery object, but it's taking way >> too much time, so I thought that it could be faster if I make >> an array buffer out of them and then aggregate the array >> as a whole, but I don't find out how to do it. > > Can you provide a little more detail about how you end up with 50 jQuery > objects that you need to combine? > > > ___ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > > -- View this message in context: http://www.nabble.com/How-do-I-add-a-js-array-of-jquery-objects-to-a-jquery-object--tf2614381.html#a7308883 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] How do I add a js array of jquery objects to a jquery object?
Maybe there are other solutions to what I'm looking for... I've got a jquery script where I append (one by one) 50 new jquery objects to another jquery object, but it's taking way too much time, so I thought that it could be faster if I make an array buffer out of them and then aggregate the array as a whole, but I don't find out how to do it. -- View this message in context: http://www.nabble.com/How-do-I-add-a-js-array-of-jquery-objects-to-a-jquery-object--tf2614381.html#a7296909 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Chili syntax highlighter updated
Many thanks for adding Chili to the jQuery.com plugins page. I've just released a new version, 1.2 I'd appreciate very much if you could change the link so that it points to http://www.mondotondo.com/aercolino/noteslog/?cat=8 which is the page where I post new releases Also may interest you that I've wordpressed the text manual, and posted it here http://www.mondotondo.com/aercolino/noteslog/?page_id=79 -- View this message in context: http://www.nabble.com/Chili-syntax-highlighter-updated-tf2603201.html#a7263097 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Is there a way to reply to someone's post...
Blair McKenzie-2 wrote: > > You could use the Nabble archive > Nabble seems a good solution. Thanks Blair. -- View this message in context: http://www.nabble.com/Is-there-a-way-to-reply-to-someone%27s-post...-tf2463061.html#a6871739 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] jQuery API discussion
I think that there is space for improvement on both sides of API architecture and its documentation. We all like jQuery for how it looks like. We like its chainability, we like its alchemy. So we must preserve what we like most as much as possible, and doing so we'll also get to an evolution as opposed to a revolution. Sorry for my pomposity. API architecture - I'll leave this entirely in your hands, because my undestanding still needs to deepen more. Just one advice and one idea. Here goes the advice. People like to do things their way. So two ways of doing something, are always better than one. On this principle is based the most widespread software nowadays. And here goes the idea. I noticed many posts in this thread about the events issue. I think that bind, undind and trigger, when specialized over a click event, for example, could all three be synthesized in only one function called click. I like overloading even if I know it adds mystery. Correctly used also helps keeping tidy. bind: click(function...) trigger: click() unbind: click(null) This should be pretty clear to any programmer: unbind is like binding to nothing. If null cannot be used, any similar replacement will work: nothing, "", 0, undefined, {}; just choose (or make) one that fits. Then there is the difference between one shot and burst mode. This could be coped with by adding an optional boolean (or enum) argument. This way a 6 functions will be compressed into only one name. wow API documentation -- There is an official documentation that comes right from the source with an XML to HTML clockwork. I'll speak about this one. Functionalities must be differentiated from functions. Functionalities need a unique id number. Functionalities need their own filecard. Functionalities need not be spread among many filecards. Pseudo-Signatures can be augmented to represent optional arguments and their default values. Filecards must cross reference each other on an "as needed" basis, but also on a more regular basis, like a section for referencing similar functionalities, or a reference to the group of their common function name. Keywords must be added to functionalities and "deprecated" should be a keyword. Documentation must be made available through browsing, references, keywords, categories and searches. Examples must be improved on many levels. (see my third post in my blog) Here is something that goes towards what I mean: http://www.mondotondo.com/aercolino/jquery/docs/API/jquery-api2.xml I only wrote again the documentation of the items with a number, whereas items with a # are original content. And there are three posts in my blog with all the ideas and details: 1: http://www.mondotondo.com/aercolino/noteslog/?p=42 2: http://www.mondotondo.com/aercolino/noteslog/?p=62 3: http://www.mondotondo.com/aercolino/noteslog/?p=65 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Is there a way to reply to someone's post...
Adrian, I don't have access to the headers because I don't have the email message at all. I'm subscribed to the list so I can post, if I want to. But I unchecked the service of the mailer program at jQuery, so I'm actually not receiving any message to my inbox. I found that browsing the archives is much more effective to me. IMO this is an option that should be promoted because it saves bytes to everyone involved. As I suggested, all posts to discuss@jquery.com get an id, which is then represented as the last item in the link to the message. For example my first message about this issue got 014492 and your reply got 014497. This is a very simple Id to retrieve. If I had had the option to reply to your reply by specifying a Subject like "014497; Is there a way - Adrian", and have my message properly threaded below yours, then discussions would be much easier to read through. And my sent messages would get a Subject which would also be easy to categorize here, inside my mail program. Spam should not be an issue, because the mailer at jQuery will filter out all messages not coming from subscribers anyway. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Is there a way to reply to someone's post...
without using the Reply button in a mail program? I've disabled that checkbox in my jQuery profile for receiving messages from the list. I really prefer to browse the archives. But for replying specifically to someone's post, what can I do? Opening a new thread with the old subject is my unique option? If there is no other option, could someone apply a little patch for making it possible to use a special Subject for this purpose? I'm sure it could be done in jQuery! A simple script for reorganizing the archive page by thread, based on a Subject like "014226; jQuery API discussion - Jörn Zaefferer". Where the first number is the message I want to reply to, and the remaining text is just for me, and should be discarded.___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Highlighting jQuery
Hola. I was quite sure that Chili did not work in Safari, very sorry for that, but I have no means for testing Safari on a PC, or am I wrong? Using my PC, I tested Chili on IE, Firefox, Mozilla and Opera, all latest versions, and it works fine. The first three browsers show the highlighting identically, but Opera adds one empty line after each line. I'll try to fix this in the near future. As for Safari, I don't know anything about it. If someone wants to help me with this issue, I'll be very glad to add a fix asap. Ciao, Andrea ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Highlighting jQuery
Hola. I just released Chili, a free syntax highlighter script, written in jQuery, and based on the Dan Webb's Code Highlighter, which I found a couple of weeks ago thanks to a link on the jQuery site. Chili is compatible with Code Highlighter's language definition files, but it is othwerwise a new piece of software (re-engineered and fixed), fully documented, and really based on jQuery functionalities. I posted a zip file with all inside and put the manual and two examples one click away. http://www.mondotondo.com/aercolino/noteslog/?cat=8 The example "Chili highlighting jQuery" shows how Chili can be used for highlighting jQuery scripts. Hasta pronto, Andrea ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] slashing
I 've found that addresses like http://jquery.com/dev/ don't work if the last slash is stripped off. I think they should be mapped to the slash version in the server configuration. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Rev: 259, where is now?
thanks John! That's what I was after. - Original Message From: John Resig <[EMAIL PROTECTED]>To: jQuery Discussion. Sent: Tuesday, October 3, 2006 8:27:44 PMSubject: Re: [jQuery] Rev: 259, where is now? I do have one pre-built one that I re-generate every couple days, youcan find it here:http://jquery.com/src/jquery-svn.jsHaving a nice historical listing would be nice too, as you suggest -but this should be good for now.--JohnOn 10/3/06, Andrea Ercolino <[EMAIL PROTECTED]> wrote:>> ok>> Now I understand that there is no release newer thah the 249, which is> currently linked as the latest one in jquery.com>> Would it be possible to post a build, once in a while?> The dev page in jquery.com should be the right place for a section of this> type.>> <> Latest Rev: 387 (to be built). Previous builds follow:> ...> Rev: 259 - 2006-09-01 02:22:39 -0400 (Fri, 01 Sep 2006)> ...> Rev: 249 - 2006-08-31 13:26:31 -0400 (Thu, 31 Aug 2006)> ...> >>> I still don't know where I got this 259, without building it myself>> /*> * jQuery - New Wave _javascript_> *> * Copyright (c) 2006 John Resig (jquery.com)> * Dual licensed under the MIT (MIT-LICENSE.txt)> * and GPL (GPL-LICENSE.txt) licenses.> *> * $Date: 2006-09-01 02:22:39 -0400 (Fri, 01 Sep 2006) $> * $Rev: 259 $> */>>> - Original Message > From: Franck Marcia <[EMAIL PROTECTED]>> To: jQuery Discussion. > Sent: Tuesday, October 3, 2006 6:36:24 PM> Subject: Re: [jQuery] Rev: 259, where is now?>>> 2006/10/3, Andrea Ercolino <[EMAIL PROTECTED]>:> >> > Thanks Franck, but I feel a dummy now.> > Where is the link to download this 387 version?> >>> There's currently no prebuilt jquery.js from svn. You must do it> yourself using a svn client. On Windows, you can use TortoireSVN> (http://tortoisesvn.net/).>> But that's not the end. Once you get it, you must install/use ant or> make to build jquery. There's a recent thread on this in the mailing> list. However and Michael said, you can build it yourself "manually".>> Franck.>> ___> jQuery mailing list> discuss@jquery.com> http://jquery.com/discuss/>>>> ___> jQuery mailing list> discuss@jquery.com> http://jquery.com/discuss/>>>-- John Resighttp://ejohn.org/[EMAIL PROTECTED]___jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Rev: 259, where is now?
ok Now I understand that there is no release newer thah the 249, which is currently linked as the latest one in jquery.com Would it be possible to post a build, once in a while? The dev page in jquery.com should be the right place for a section of this type. < Latest Rev: 387 (to be built). Previous builds follow: ... Rev: 259 - 2006-09-01 02:22:39 -0400 (Fri, 01 Sep 2006) ... Rev: 249 - 2006-08-31 13:26:31 -0400 (Thu, 31 Aug 2006) ... > I still don't know where I got this 259, without building it myself /* * jQuery - New Wave _javascript_ * * Copyright (c) 2006 John Resig (jquery.com) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * $Date: 2006-09-01 02:22:39 -0400 (Fri, 01 Sep 2006) $ * $Rev: 259 $ */ - Original Message From: Franck Marcia <[EMAIL PROTECTED]>To: jQuery Discussion. Sent: Tuesday, October 3, 2006 6:36:24 PMSubject: Re: [jQuery] Rev: 259, where is now? 2006/10/3, Andrea Ercolino <[EMAIL PROTECTED]>:>> Thanks Franck, but I feel a dummy now.> Where is the link to download this 387 version?>There's currently no prebuilt jquery.js from svn. You must do ityourself using a svn client. On Windows, you can use TortoireSVN(http://tortoisesvn.net/).But that's not the end. Once you get it, you must install/use ant ormake to build jquery. There's a recent thread on this in the mailinglist. However and Michael said, you can build it yourself "manually".Franck.___jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Rev: 259, where is now?
Thanks Franck, but I feel a dummy now. Where is the link to download this 387 version? - Original Message From: Franck Marcia <[EMAIL PROTECTED]>To: jQuery Discussion. Sent: Tuesday, October 3, 2006 6:09:43 PMSubject: Re: [jQuery] Rev: 259, where is now? > I don't know how I got Rev: 259, because current latest is 249. I wandered> around but I cannot find a link to it in jquery.com.>The last rev is #387, accessible via svn (http://jquery.com/src/)> 259 works better with IE than 249> For example, 259 let me access tabs in a pre tag, while 249 doesn't>>It should be better and better ;-)Franck.___jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Rev: 259, where is now?
thanks, but really I meant "where do I get a Rev >= 259?" - Original Message From: Webunity | Gilles van den Hoven <[EMAIL PROTECTED]>To: jQuery Discussion. Sent: Tuesday, October 3, 2006 6:06:34 PMSubject: Re: [jQuery] Rev: 259, where is now? Andrea Ercolino wrote:> I don't know how I got Rev: 259, because current latest is 249. I > wandered around but I cannot find a link to it in jquery.com.Each time someone of the developers (like me) commit something, the version number is increased. Therefore since your last download, 10 commitments where done, leaving you at 259. The exact size of each commitment is very different. One time it is only 1 small bug, the other time it is a bigger list of bugs.HTH, GIlles___jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Rev: 259, where is now?
I don't know how I got Rev: 259, because current latest is 249. I wandered around but I cannot find a link to it in jquery.com. 259 works better with IE than 249 For example, 259 let me access tabs in a pre tag, while 249 doesn't ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/