Re: [jQuery] Dom creation
On 17/08/06, Michael Geary [EMAIL PROTECTED] wrote: From: Aloyzas Rimeika ...But I recommend use $.dom plugin only in XHTML pages with MIME type application/xhtml+xml http://www.quirksmode.org/bugreports/archives/2004/11/innerhtml_in_xh.html Easier and faster solution is innerHTML http://www.quirksmode.org/dom/innerhtml.html For example: var json = [ {'name' : John, 'surname' : Smith}, {'name' : Sarra, 'surname' : Smith} ]; var table = $('#fill-table tbody'); $.each(json, function(){ table.append('tr class=MyTableRow' +'td class=MyTableCol1'+ this.name +'td class=MyTableCol2'+ this.surname +'/tr'); }); I'm with you there. I have switched most of my code from DOM creation to innerHTML. BTW, you can speed up this kind of code by using Array.join instead of string concatenation: var table = $('#fill-table tbody'); $.each(json, function(){ table.append( [ 'tr class=MyTableRow', 'td class=MyTableCol1', this.name, '/td', 'td class=MyTableCol2', this.surname, '/td', '/tr' ].join('') ); }); It won't make a huge difference in a simple case like this, but if you're concatenating very many strings, Array.join really speeds things up in most browsers. -Mike Doesn't this work: $('#fill-table tbody').append(json, [ 'tr class=MyTableRow', 'td class=MyTableCol1', this.name, '/td', 'td class=MyTableCol2', this.surname, '/td', '/tr' ].join(''); ); If not, perhaps it should be added to jQuery? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Help with the SVN Build Process
On 16/08/06, John Resig [EMAIL PROTECTED] wrote: Step 1: Go to this page and download and install Java Runtime Environment (JRE) 5.0: http://java.sun.com/javase/downloads/index.jsp Step 2: Download and install Apache Ant: http://ant.apache.org/bindownload.cgi Step 3: Go to the jQuery directory and type 'ant'. You now have a compiled version of jQuery, the documentation, and the test suite. Steps 2 3 Change depending if you're using Ant or the Makefile. Since jQuery now includes the Ant build file, it's much easier to simply use that (and more cross-platform). For UNIX-type people, like myself, I'll just see the Makefile, type Make, and be done with it. I recommend that you check out the new, updated, README file in jQuery SVN - as it explains this whole process. --John Perhaps it may be benefitial if you could also build jQuery using NAnt or MSBuild - if you don't want / don't have Java or Make? Is there a way to check out jQuery without using SVN (ISA server blocks essential HTTP commands (PROPFIND) needed by SVN - error 400: Bad Request)? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Dom creation
Doesn't this work: $('#fill-table tbody').append(json, [ 'tr class=MyTableRow', 'td class=MyTableCol1', this.name, '/td', 'td class=MyTableCol2', this.surname, '/td', '/tr' ].join(''); ); If not, perhaps it should be added to jQuery? Not the json/templating stuff - but you can append trs to both tables and tbodys (jQuery takes care of all the innerHTML details to make it work cross browser). --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Can jQuery SVN get / set element dimensions?
Does jQuery SVN have any functions for getting the dimensions (left, right, top, bottom, width, height, z-index) of an element? Something that also works across different browsers. I want to be able to do something like this: var me = $(#myelement); var meD= $(#myelement).dimensions(0); // dimensions() would also get the first match var left = meD.left; Or maybe a better way (having left, right, top etc as methods): // set left, top and height (chain not broken) $(#myelement).left(12px).top(-2em).height(6em); // get width (chain broken) var width = $(#myelement).width(); ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Tabs plugin feature request
Hi KlausI've been playing around with your tabs plugin, and would very much like it if you could add a callback facility. ie, when the tab is changed, i'd like a function to be called in the scope of the active tab. I can make this change myself, but dont know whether i have the latest version. does the URL quoted below contain the latest version?RegardsAshutoshOn 8/3/06, Klaus Hartl [EMAIL PROTECTED] wrote: Tabs:http://stilbuero.de/jquery/tabs/(Note: can now use fade and slide for switching tabs. slide is slightlybroken in latest svn version...) ___jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/ -- Reach1to1 Communicationshttp://www.reach1to1.com[EMAIL PROTECTED]98201-94408 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] New plugin: Autocompleter
On 17/08/06, Dan Atkinson [EMAIL PROTECTED] wrote: Scratch that! I replaced 'onItemSelect: navigate' for 'onItemSelect: navigation'!!! :) Thanks again Sam! That was a typo I made. Good that you spotted it though! ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Rebind events on dynamic content (modified DOM)
Hi Guys, I'm fairly new to Jquery but love it! My problem: I'm loading some DIV in to a container DIV using AJAX... all works like a charm. However, I need to bind some events to the DIVs I'm dynamically loading in, no joy :( I guess I need to refresh the DOM somehow? My code looks like: $(#daysheader).load(ajax/weekview_headers.aspx?fromdate= + calendarDay.Date); $(#days).load(ajax/weekview_appointments.aspx?fromdate= + calendarDay.Date); BindTimeSelectors(); function BindTimeSelectors() { //Wire up mouse down events to the day selectors. $(#day1selector).mousedown(function(){mouseDown(day1selector);}); $(#day2selector).mousedown(function(){mouseDown(day2selector);}); $(#day3selector).mousedown(function(){mouseDown(day3selector);}); $(#day4selector).mousedown(function(){mouseDown(day4selector);}); $(#day5selector).mousedown(function(){mouseDown(day5selector);}); } ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery vs Prototype
Oh yeah, and also because of the Devo hat logo. It just does it for me. Hey John, if you ever get tired of the New Wave Javascript tagline, how about Whip Your Scripts Into Shape? Haha! I like that a lot :-) Maybe that'll be the tag line for the re-launched site. Or maybe something like Whipping Javascript into Shape. I like those a lot :-) --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Can jQuery SVN get / set element dimensions?
On 17/08/06, John Resig [EMAIL PROTECTED] wrote: Or maybe a better way (having left, right, top etc as methods): // set left, top and height (chain not broken) $(#myelement).left(12px).top(-2em).height(6em); // get width (chain broken) var width = $(#myelement).width(); Have you tried this yet? It works, verbatim. :-) All those methods are detailed in the new docs (temporary URL): http://john.jquery.com/jquery/docs/ --John The problem is if you want the dimensions of an element that is not positioned via CSS, i.e. to get the left position: var left = el.offsetLeft; do { el = el.offsetParent, left+= el.offsetLeft, top+= el.offsetTop; } while (el.offsetParent); I think offsetLeft (and offsetTop, offsetWidth, offsetHeight) are supported by all those browsers jQuery works with - as el.y and el.x are for Netscape 4. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Can jQuery SVN get / set element dimensions?
On 17/08/06, John Resig [EMAIL PROTECTED] wrote: The problem is if you want the dimensions of an element that is not positioned via CSS, i.e. to get the left position: True - and a request for it is already in the bug tracker. However, it's just not going to happen before 1.0 proper - it's in a feature freeze right now. --John I suppose it could be implemented as a plugin (until it makes it into 1.1). I do make an assumption that looping through the offsetParent's works across all modern browsers - I can only really test on what is available on Windows (so no Safari, Konqueror etc). ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Can jQuery SVN get / set element dimensions?
I suppose it could be implemented as a plugin (until it makes it into 1.1). I do make an assumption that looping through the offsetParent's works across all modern browsers - I can only really test on what is available on Windows (so no Safari, Konqueror etc). As far as I know, those properties work in all browsers that jQuery supports. If you wanna work on it, then you're more than welcome to. I was going to have functions like the following: .leftFromParent() .leftFromDocument() .leftFromWindow() .topFromParent() .topFromDocument() .topFromWindow() Or maybe that can be shortened to .topParent() .leftDocument() ? This way .top() and .left() will still return the un-touched CSS property (if it's needed). Let me know how this sounds to you. --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] $(this).getAttribute(href) Doesn't work
hey , I found a solution that works correctly. try this.. $.attr($('a').get(0),'href') 100% works its called by first value is object, then 2nd value is attribute -- Nilesh B. Patel Contact: 704.723.6427 website: www.n-bp.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Form Handling
Another newbie question. I was looking at some cool form handling features of prototype (about half-way down this article: http://www.sitepoint.com/print/painless-_javascript_-prototype) and was trying to figure out jQuery has similar features. I'm a little confused I see the form plugin referenced from http://proj.jquery.com/plugins does some of what I'm looking for (such as serialize), but it also looks like some (maybe all?) of this functionality is already baked into the core jQuery library. Is this just simply not documented yet? Is there a good current overview of the latest built-in form handling features? 2 specific functions of prototype that I think look particularly useful are Form.Observer and Form.EventObserver. The former checks all form fields at a specified periodic interval and calls a specified callback if anything changes. The latter is similar only it listens for all relevant change events (onchange, onclick) of all form fields rather than polling at intervals. Does the core jQuery and/or an existing plugin have a similar feature? Sorry if I completely missed it - I dug around a bit and didn't find anything. Also, until the new site is launched, is proj.jquery.com the place to go (rather than jquery.com) for the most current info and documentation? Thanks! Todd ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Multiple $(document).ready()'s...
Tom Holder schrieb: Hi Jason, Just simply add an Init function to each file and then call each one from a single document.ready. Hope this helps. This is absolutely not necessary. You can have as much $(document).ready as you want in different plazes. The event handler functions are queued. -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Rebind events on dynamic content (modified DOM)
Michael Geary schrieb: You are calling BindTimeSelectors before the AJAX load is complete. Which AJAX load is the one that BindTimeSelectors depends on? Assuming it is the second one, you could code it like this: $(#daysheader).load( ajax/weekview_headers.aspx?fromdate= + calendarDay.Date ); $(#days).load( ajax/weekview_appointments.aspx?fromdate= + calendarDay.Date, BindTimeSelectors() ); I think it should read: $(#days).load( ajax/weekview_appointments.aspx?fromdate= + calendarDay.Date, BindTimeSelectors ); -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Improvements in Ajax facilities - error handling?
Andy Matthews wrote: Speaking of errors... That's one thing I've really wanted. When using jQuery, I've noticed that assuming all of the syntax is valid, if you run code that doesn't work, nothing happens. No error message, nothing. That makes debugging quite difficult because you have no idea where to start. Is there any way that jQuery could generate SOME sort of error, a default alert box maybe) with error information? That would be stellar. Maybe I'm just too knew to jquery to understand how to go about debugging, but I keep running into this problem (since my newbie code is usually wrong, even if syntactically correct). The only error I ever see in the console is f has no properties, jquery.js line 14, which obviously isn't my code. :P Cheers, Jason -- View this message in context: http://www.nabble.com/Improvements-in-Ajax-facilities-tf2119204.html#a5858298 Sent from the JQuery forum at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Tabs plugin feature request
ashutosh bijoor schrieb: Hi Klaus I've been playing around with your tabs plugin, and would very much like it if you could add a callback facility. ie, when the tab is changed, i'd like a function to be called in the scope of the active tab. I can make this change myself, but dont know whether i have the latest version. does the URL quoted below contain the latest version? Regards Ashutosh This can be very useful... I will add that soon! -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Tabs plugin feature request
-- Larry Garfield On Thu, August 17, 2006 3:19 pm, Klaus Hartl said: ashutosh bijoor schrieb: Hi Klaus I've been playing around with your tabs plugin, and would very much like it if you could add a callback facility. ie, when the tab is changed, i'd like a function to be called in the scope of the active tab. I can make this change myself, but dont know whether i have the latest version. does the URL quoted below contain the latest version? Regards Ashutosh This can be very useful... I will add that soon! -- Klaus Use case here: You have n tabs. Each one is not actually loaded. When you switch to it, however, a callback fires that Ajax-loads the contents of that tab, possibly skipping that if it's already been loaded. Taing it a step further, an on-leaving callback would let you auto-submit a form in a given tab as soon as you tab away from it. Instant-save tabbed forms for the cost of 2 callbacks. Sorry, I just put 2 and 2 together and got a very cool 10. :-) --Larry Garfield ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Tabs plugin feature request
Hi Larry! You have n tabs. Each one is not actually loaded. When you switch to it, however, a callback fires that Ajax-loads the contents of that tab, possibly skipping that if it's already been loaded. Sorry, I just put 2 and 2 together and got a very cool 10. :-) Sounds interessting. But if I get it right, those tabs wouldn't be unobtrusive any more, right? -- Jörn ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Dom creation
Hey things seem to be going along nicely just need a push over the edge :) http://3spn.net/jQuery/dom_creation.html I have constructed a dummy array i need to figure out how to transverse and access the data i know it should be simple reading around now might not need help. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Any IE6 related input element changes recently?
It works normally in firefox, so i don't understand why it doesn't in IE5. Sounds like you meant IE6, it's working fine in IE6 for me (SVN 169 was what I had handy). What version of jQuery are you using? Going to jquery.com I did notice that it's very easy to grab an ancient version of the code. The latest version is from May. Since John's only days away from the 1.0 release that problem should go away--and be replaced by calls for updated documentation. :-) ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Tabs plugin feature request
On Thu, August 17, 2006 3:55 pm, Jörn Zaefferer said: Hi Larry! You have n tabs. Each one is not actually loaded. When you switch to it, however, a callback fires that Ajax-loads the contents of that tab, possibly skipping that if it's already been loaded. Sorry, I just put 2 and 2 together and got a very cool 10. :-) Sounds interessting. But if I get it right, those tabs wouldn't be unobtrusive any more, right? -- Jörn True, if you go with dynamic loading of tab content then it doesn't degrade nicely. That's a trade-off with any dynamic-content-loading system. But if you don't do that, then the tab system itself would still degrade nicely. --Larry Garfield ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Tabs plugin feature request
Jörn Zaefferer schrieb: Hi Larry! You have n tabs. Each one is not actually loaded. When you switch to it, however, a callback fires that Ajax-loads the contents of that tab, possibly skipping that if it's already been loaded. Sorry, I just put 2 and 2 together and got a very cool 10. :-) Sounds interessting. But if I get it right, those tabs wouldn't be unobtrusive any more, right? -- Jörn Yes, such tabs wouldn't be accessible anymore, and not unobtrusive either because you would have useless links hanging around, pointing to some empty divs if JavaScript is disabled. Therefore I wouldn't go so far and implement Ajax calls on tab click. I cannot see the use here, to me it's like using Ajax for the sake of Ajax. The user would even have to wait for the content to be loaded (first click), and that is not what I call very usable. Nonetheless, with the callback mechanism it would be pretty easy to implement such a function and pass it as callback. But this should not be part of the plugin in my eyes. -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Tabs plugin feature request
ashutosh bijoor schrieb: Hi Klaus I've been playing around with your tabs plugin, and would very much like it if you could add a callback facility. ie, when the tab is changed, i'd like a function to be called in the scope of the active tab. I can make this change myself, but dont know whether i have the latest version. does the URL quoted below contain the latest version? Regards Ashutosh I assume you would like to have the possibility to have different callbacks for each tab or alternatively one function for all or even both together? -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] JSON Arrays *tad off topic hehe*
I am useing JSON.php to convert my mutli demional array in to json. I am just posting it in to a var for now testing the innerhtml creates i need some help on figuring out how to access the array once in the js block. http://3spn.net/jQuery/dom_creation.html I have constructed a dummy array that is the same as the php ajax responce will put out. I did double post this to a point i moved it out side of the dom creation topic header! :) ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Fwd: Tabs plugin feature request
Oops attachment not accepted... pls find code below-- Forwarded message --From: ashutosh bijoor [EMAIL PROTECTED] Date: Aug 18, 2006 7:30 AMSubject: Re: [jQuery] Tabs plugin feature requestTo: jQuery Discussion. discuss@jquery.comHi Pls find attached, jtabs.js with the callback modification. Basically added the following lines at line number 72: // apply callback function if defined if (typeof options.callback != 'undefined' options.callback.constructor==Function) { options.callback.apply(target,[target.attr('id'),visible.attr('id')]); }Here, I'm passing two parameters to the callback: - the id of the new tab's container and- the id of the new tab's containerAlso, this will point to the current tabRegardsAshutosh On 8/18/06, Klaus Hartl [EMAIL PROTECTED] wrote: ashutosh bijoor schrieb: Hi Klaus I've been playing around with your tabs plugin, and would very much like it if you could add a callback facility. ie, when the tab is changed, i'd like a function to be called in the scope of the active tab. I can make this change myself, but dont know whether i have the latest version. does the URL quoted below contain the latest version? Regards AshutoshI assume you would like to have the possibility to have different callbacks for each tab or alternatively one function for all or evenboth together?-- Klaus___jQuery mailing list discuss@jquery.comhttp://jquery.com/discuss/ -- Reach1to1 Communicationshttp://www.reach1to1.com [EMAIL PROTECTED]98201-94408 -- Reach1to1 Communicationshttp://www.reach1to1.com[EMAIL PROTECTED]98201-94408 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/