[jQuery] Disabling a tags
Hello folks, Another simple question I'm sure. I have a preview page in which I want to display the text of a tags, but to disable the tag by changing its href contents to #. The code I use to populate the div (#preview) after an ajax call is function showResponse(json) { if (json.fields) { for (var i = 0; i json.fields.length; i++) { var field = json.fields[i]; $(#theIndicator).hide(); switch(field.yesno) { case Y: $(div#preview).html(field.preview); $(div#preview a).href('#'); $(div#content_editor).highlightFade({color:'yellow',speed:2000,iterator:'sinusoidal'}); $(#sMoreLinks, #sMoreLinksText, #sMoreLinksDesc).val(''); $('#sMoreLinksAction').val(add) $(#sMoreLinksDiv).html(field.linktable); break; case N: $(div#content_editor).highlightFade({color:'red',speed:2000,iterator:'sinusoidal'}); $('#links_fback').html(field.message).addClass(error).show(); } } } } My attempt ($(div#preview a).href('#');) does not work - I don't understand why it doesn't. Any suggestions/insights? Thanks, Bruce ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] passing functions
dmoshal schrieb: Karl, using object literals seems to work: var a = { foo: function() { } } function bar (a) { $(elem).click (a.foo) } bar (a) Dave And that of course is exactly the same as this: function foo() { } function bar(a) { $(elem).click(a); } bar(foo); -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] passing functions
That's what I tried initially - though for some reason didn't seem to work! Out of interest - what technique are folks using to create the dom elements? raw HTML? domBuilder? Dave Klaus Hartl wrote: dmoshal schrieb: Karl, using object literals seems to work: var a = { foo: function() { } } function bar (a) { $(elem).click (a.foo) } bar (a) Dave And that of course is exactly the same as this: function foo() { } function bar(a) { $(elem).click(a); } bar(foo); -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/passing-functions-tf2805241.html#a7829909 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Disabling a tags
Sam Collett schreef: That prevents the link being followed, but still keeps the href the same (incase you want to enable it again). Also, I think it is better performance wise to use '#myid' rather than 'div#myid' I thought div#myid was less generic than #myid so that the performance would improve using something like that. #myid could match a form, a div or some other tag you apply the id to. -- David Duymelinck [EMAIL PROTECTED] ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] passing functions
Hi in jQuery bug list, i find in IE, ajaxStart return the error NULL, please tell me the bug was closed? and i use 1.0.3, the ajaxStart is not Work. yours 齐永恒 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Disabling a tags
Bruce MacKay schrieb: Hello folks, Another simple question I'm sure. I have a preview page in which I want to display the text of a tags, but to disable the tag by changing its href contents to #. The code I use to populate the div (#preview) after an ajax call is function showResponse(json) { if (json.fields) { for (var i = 0; i json.fields.length; i++) { var field = json.fields[i]; $(#theIndicator).hide(); switch(field.yesno) { case Y: $(div#preview).html(field.preview); $(div#preview a).href('#'); $(div#content_editor).highlightFade({color:'yellow',speed:2000,iterator:'sinusoidal'}); $(#sMoreLinks, #sMoreLinksText, #sMoreLinksDesc).val(''); $('#sMoreLinksAction').val(add) $(#sMoreLinksDiv).html(field.linktable); break; case N: $(div#content_editor).highlightFade({color:'red',speed:2000,iterator:'sinusoidal'}); $('#links_fback').html(field.message).addClass(error).show(); } } } } My attempt ($(div#preview a).href('#');) does not work - I don't understand why it doesn't. Any suggestions/insights? Thanks, Bruce Bruce, don't know why it doesn't work... But for disabing I recommend using return false anyway. If the page is scrolled down a little bit and you would click on such a link, the page would scroll to the top: My proposal (plus a little optimization): $(#preview).html(field.preview).find('a').click(function() { return false; }); Note that div#preview will be slower than #preview, because in the first case all divs in the DOM tree have to be searched and then the one with the proper id instead of immediatly using document.getElementById. It's the other way round with classes (always prefer div.theClass over .theClass). -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Disabling a tags
On 12/12/06, David Duymelinck [EMAIL PROTECTED] wrote: I thought div#myid was less generic than #myid so that the performance would improve using something like that. #myid could match a form, a div or some other tag you apply the id to. This might be true in CSS, but when jQuery sees something like #myid, it turns that into document.getElementById(myid) which is very fast. I can't say for sure, but I think that if jQuery saw something like div#myid, it would do document.getElementsByTagName(div) and then document.getElementById(myid) -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Trouble with $(expr, context) and iframe documents
Michael Geary schrieb: From: Adam Skinner I'm trying to reference an element from within an iframe. The following normal javascript code works: var iframeDoc = window.frames[iframeName].document; var data = iframeDoc.getElementById(iframeElement); I'm trying to jqueryize the data variable as follows (using the actual element id name for the time being): var d2 = $(#inside_iframe_element,iframeDoc); This just yields [], however. How do I refer to an element within the iframe? Take a look at the code that handles the # selector in jQuery and you will see why this doesn't work: if ( m[1] == # ) { // Ummm, should make this work in all XML docs var oid = document.getElementById(m[2]); r = ret = oid ? [oid] : []; t = t.replace( re2, ); } else { It's using a hard coded document.getElementById() instead of using the document you provide. Couldn't that be solved by using: var oid = self.document.getElementById(m[2]); Not tested, not sure... -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Disabling a tags
Aaron Heimlich schrieb: On 12/12/06, *David Duymelinck* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I thought div#myid was less generic than #myid so that the performance would improve using something like that. #myid could match a form, a div or some other tag you apply the id to. This might be true in CSS, but when jQuery sees something like #myid, it turns that into document.getElementById(myid) which is very fast. I can't say for sure, but I think that if jQuery saw something like div#myid, it would do document.getElementsByTagName(div) and then document.getElementById(myid) I think it's even worse. It has to go through all the divs and check the id... document.getElementById cannot be used for such a list returned by document.getElementsByTagName(div). -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Disabling a tags
On 12/12/06, Klaus Hartl [EMAIL PROTECTED] wrote: I think it's even worse. It has to go through all the divs and check the id... document.getElementById cannot be used for such a list returned by document.getElementsByTagName(div). Yeesh! NOTE TO ALL: div#myid = SLOW!! #myid = FAST!! .myclass = SLOW!! div.myclass = FAST(er)!! -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] .selectedIndex VS jQuery
Why doesn't $(#b6).selectedIndex = $(#s6).selectedIndex; work? (Assuming #b6 and #s6 are similar select boxes of course. Copying billing to shipping address BTW) I know it's not really how jQuery code usually works, but would like to understand why not. -- View this message in context: http://www.nabble.com/.selectedIndex-VS-jQuery-tf2806806.html#a7831040 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] .selectedIndex VS jQuery
$() gets you a jQuery object, so you can use it with jQuery methods etc. To access selectedIndex you need the actual element, so try: $(#b6)[0].selectedIndex = $(#s6)[0].selectedIndex; Chris ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] .selectedIndex VS jQuery
jazzle schrieb: Why doesn't $(#b6).selectedIndex = $(#s6).selectedIndex; work? (Assuming #b6 and #s6 are similar select boxes of course. Copying billing to shipping address BTW) I know it's not really how jQuery code usually works, but would like to understand why not. What $(#b6) returns is a jQuery object that contains one or more elements (nodes), e.g. the search result of the expression that you passed in. If you want to access DOM properties of an element you have get them out ouf the jQuery object first. This can be done via the get(n) method or with simple Array index notation: var firstElem = $(div).get(0); var secondElem = $(div)[1]; Be careful with that: It may be the case that there is no second element, so if you try to access secondElem (which is undefined in that case) it may throw an error: secondElem.className = 'foo'; // may throw an error In such cases it's better to stick to jQuery methods like each() to prevent such errors. Your example again (untestet): $(#b6).get(0).selectedIndex = $(#s6).get(0).selectedIndex; and more jQuerish (assuming that the value corresponds to the selected index): $('#b6').val( $(#s6).val() ); -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Disabling a tags -- thanks
Thank you all for the solutions and the additional lesson about div#myID - much appreciated. -- Bruce ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Problem about ajax readyState
the same post content, i don't know why the result have different. please help me Try printing out the status attribute of the XMLHttpRequest object. That might give you an idea of why it's failing. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Disabling a tags
On 12/12/06, Aaron Heimlich [EMAIL PROTECTED] wrote: On 12/12/06, Klaus Hartl [EMAIL PROTECTED] wrote: I think it's even worse. It has to go through all the divs and check the id... document.getElementById cannot be used for such a list returned by document.getElementsByTagName(div). Yeesh! NOTE TO ALL: div#myid = SLOW!! #myid = FAST!! .myclass = SLOW!! div.myclass = FAST(er)!! #foo #bar = BUGGY!! -- Choan http://choangalvez.nom.es/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Problem about ajax readyState
i use jQuery ajax , in some times, the ajax submit was wrong, but some time,it is right. so i log the trace. Jake, can you log a network trace with a utility like Ethereal? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] unload and unload
Hello I'm a bit puzzled by the existence of two unload functions in jQuery - one which is the unbinder for load, and one which is the binder for unload. Now, the way it's currently implemented, the unload event binder will probably simply overwrite the load unbinder, if I understand the source correctly? I'm a bit concerned about what the behavior is which the API actually guarantees and which I can rely on? -- Markus Peter - SPiN AG [EMAIL PROTECTED] ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] unload and unload
I'm a bit puzzled by the existence of two unload functions in jQuery - one which is the unbinder for load, and one which is the binder for unload. Now, the way it's currently implemented, the unload event binder will probably simply overwrite the load unbinder, if I understand the source correctly? The best thing to do is always use .bind(event, fn) for your events. There is no ambiguity when you do that. Many of those confusing shortcuts will be going away in an upcoming version. Speaking of that, can we undocument those *now* but still leave them in while the discussion goes on about what exactly will be removed? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] using .load() and getting a 404 response
Hi Dave, Can you provide me some example code to check those two options? I don't see that documented in the API. Jeff On 12/11/06, Dave Methvin [EMAIL PROTECTED] wrote: I was wondering about using the .load() method with jQuery. I have some code that works great, however if for some reason the page that is being loaded using .load returns a 404 status, jQuery doesn't seem to recognize this - the code just continues executing. You may want to use jQuery.ajax instead of .load, it gives you a few more options about how to handle errors. Still, even with .load, your callback should be getting responseText and status as two arguments and you should be able to check status. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Dynamically changing the source of SWF call
I'm looking to try and change the source of a Flash movie using jQuery. I'm working on doing it myself, but to be honest, I'm not sur eI'll be able to figure it out, so I'm going to ask you guys. Say mc_01.swf is the initial SWF that's loaded. I want to be able to click a button/text link labeled two and have mc_02.swf load in place of mc_01.swf. I want to be able to do this for other buttons as well. I think it should be possible, but I'm just not sure how to proceed. !//-- andy matthews web developer certified advanced coldfusion programmer ICGLink, Inc. [EMAIL PROTECTED] 615.370.1530 x737 --//- ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Disabling a tags
On 12/12/06, Aaron Heimlich [EMAIL PROTECTED] wrote: div#myid = SLOW!! #myid = FAST!! .myclass = SLOW!! div.myclass = FAST(er)!! LOL, I think this is how it works in real CSS. div#myid = Faster #myid = Slow .myclass = Slow div.myclass = Fast Cheers -- Joan Piedra || Frontend webdeveloper http://joanpiedra.com/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Dynamically changing the source of SWF call
Say mc_01.swf is the initial SWF that's loaded. I want to be able to click a button/text link labeled two and have mc_02.swf load in place of mc_01.swf. I want to be able to do this for other buttons as well. I think it should be possible, but I'm just not sure how to proceed. Andy, For cross-browser reliability you'll probably want to swap out the whole object/embed tag and regenerate it for the new movie source. You can get some ideas fom this flash plugin: http://malsup.com/jquery/media/ It generates the proper HTML (using swfobject.js) and then does an empty().html(..) on the target. Mike ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Dynamically changing the source of SWF call
Okay... I've come up with code that's working in that it changes the source correctly, except that it doesn't change the display. Viewing Generated source from within the Dev toolbar in FF shows that the values are changing correctly. I also altered the code slightly to work with an image instead and it works like a charm. Anyone have any ideas? By the way, all paths are correct. html head title new document /title script type=text/javascript src=jquery.js/script script language=JavaScript !-- $(document).ready(function(){ $(a).click(function(){ var mySrc = $(this).href(); $('param').val(mySrc); $('embed').src(mySrc); return false; }); }); //-- /script /head body a href=red.swf class=redLoad red/anbsp;nbsp; a href=blue.swf class=blueLoad blue/anbsp;nbsp; a href=yellow.swf class=yellowLoad yellow/a br /br / object classid=clsid:D27CDB6E-AE6D-11cf-96B8-44455354 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.ca b#version=6,0,0,0 width=100 height=100 param name=movie value=red.swf embed src=red.swf quality=high width=100 height=100 name=movie align= type=application/x-shockwave-flash pluginspage=http://www.macromedia.com/go/getflashplayer; /object /body /html !//-- andy matthews web developer certified advanced coldfusion programmer ICGLink, Inc. [EMAIL PROTECTED] 615.370.1530 x737 --//- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Andy Matthews Sent: Tuesday, December 12, 2006 9:33 AM To: [jQuery] Subject: [jQuery] Dynamically changing the source of SWF call I'm looking to try and change the source of a Flash movie using jQuery. I'm working on doing it myself, but to be honest, I'm not sur eI'll be able to figure it out, so I'm going to ask you guys. Say mc_01.swf is the initial SWF that's loaded. I want to be able to click a button/text link labeled two and have mc_02.swf load in place of mc_01.swf. I want to be able to do this for other buttons as well. I think it should be possible, but I'm just not sure how to proceed. !//-- andy matthews web developer certified advanced coldfusion programmer ICGLink, Inc. [EMAIL PROTECTED] 615.370.1530 x737 --//- ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] interesting background issue in FF 2
Hey all, I have this page I am working on: thePage : http://ierev.informationexperts.com/test.htm http://ierev.informationexperts.com/test.htm And in FF when the box is opening or closing, there is background image thing happening. Not sure if I can explain it well. But here are the steps I take to see the issue 1. go to url 2. click on any of the top tabs ie. portfolio, gsa schedule. If you look below the box you will see the issue, if you click on gsa schedule you will see the main bg shift in the area below the accordi0n. It is like it is ghosting it. and if you click on any links about gsa, you will get a ghosting of the tabs below it. 3. click on a whats new to reopen it and you will see the ghosting again. I figure this is a css/background issue, but I was not lucky in trying to figure that out. thans all -- View this message in context: http://www.nabble.com/interesting-background-issue-in-FF-2-tf2808387.html#a7836016 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] selectable not working after loading content through .load the second time
Hi Jason, i had the same problem. If you include a script reinitialise selectables code /script at the end of the data you are loading, it should work. I assume that the onsuccess function is called before your newly loaded elements are registered in the dom. It is not slick but works. By the way - if you have a lot of elements, selectables tends to become very slow and unusable. Had to write my own version which works like paint selection in maya but is much faster. Give me a shout if you wanna try that at some point. Cheers Phil jason schleifer wrote: that's what I thought.. so the select command should work just fine.. On 12/11/06, Chris Domigan [EMAIL PROTECTED] wrote: and if I go $(#content).load() does the stuff inside #content get deleted automatically? Yes - load() overwrites the contents of the element. Chris ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- jason schleifer ah-ni-may-tor | weirdo http://jonhandhisdog.com/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/selectable-not-working-after-loading-content-through-.load-the-second-time-tf2804253.html#a7836677 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Memory leak
Thanks for your reply. I downloaded the latest from SVN and built it, but I still have the same memory leak. Anyhow I still can't figure out where the memory leak is, I'm not sure if it's my code or jQuery. Brandon Aaron wrote: Please grab the latest from SVN as it fixes the memory leak in IE. -- Brandon Aaron On 12/11/06, Ethan Hannagan [EMAIL PROTECTED] wrote: Hi, Can you help me spot what is causing the memory leak in the following code? If I click reload, bind, and clean several times, the memory allocation for IE stays still. But if I click in the reload bind and then clean, several times, the memory allocation keeps climbing. I appreciate any feedback you may have. Thanks, Ethan = html head script type=text/javascript src=jquery-1.0.3.js/script meta http-equiv=content-type content=text/html / titleIE Memory Leak/title /head body button id=reloadreload/buttonbr button id=bindbind/buttonbrbr button id=reloadnbindreload bind/buttonbrbr button id=cleanclean!/buttonbr div id=container style=border:1px solid red/div div id=counter style=border:1px solid green/div script type=text/javascript var counter = 1; function reload(callback){ $(#container).load(template.html, callback); } function bind(){ var p = $(this).find(p); p.click(function(){}); p.get(0).bigString = new Array(1000).join(new Array(1000).join(X)); $(#counter).html(counter++); } $(#reload).click(reload); $(#bind).click(bind); $(#reloadnbind).click(function(){ reload(bind); }); $(#clean).click(function(){ var p = $(#container).find(p); p.unbind(); p.get(0).onclick = null; $(#container).html(); }); /script /body /html -- View this message in context: http://www.nabble.com/Memory-leak-tf2792655.html#a7791251 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/Memory-leak-tf2792655.html#a7836682 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Versioning on Plugins page
Yep, this is in the works. Unfortunately, it's rather non-trivial. Most of the solutions that we've looked at don't provide good SVN integration. Although, some form of categorization is definitely in order, so something may be coming soon, even if it doesn't have SVN integration. --John Just wondering if there are any plans to make the to make the Plugins page (jquery.com/plugins) easier to scan and determine what's new and what has been updated without reading every entry? I think having a public Plugins SVN repository linked to Trac would be a great start. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] selectable not working after loading content through .load the second time
Heya phil! thanks for the feedback! I noticed it got very slow if I had more than 20 items selectable.. which, of course, is what I want to do.. heh :) I'd love to try the paint selection, if you've got time to send it my way! cheers! -jason On 12/12/06, floepi [EMAIL PROTECTED] wrote: Hi Jason, i had the same problem. If you include a script reinitialise selectables code /script at the end of the data you are loading, it should work. I assume that the onsuccess function is called before your newly loaded elements are registered in the dom. It is not slick but works. By the way - if you have a lot of elements, selectables tends to become very slow and unusable. Had to write my own version which works like paint selection in maya but is much faster. Give me a shout if you wanna try that at some point. Cheers Phil jason schleifer wrote: that's what I thought.. so the select command should work just fine.. On 12/11/06, Chris Domigan [EMAIL PROTECTED] wrote: and if I go $(#content).load() does the stuff inside #content get deleted automatically? Yes - load() overwrites the contents of the element. Chris ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- jason schleifer ah-ni-may-tor | weirdo http://jonhandhisdog.com/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/selectable-not-working-after-loading-content-through-.load-the-second-time-tf2804253.html#a7836677 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- jason schleifer ah-ni-may-tor | weirdo http://jonhandhisdog.com/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] passing functions
齐永恒 schrieb: Hi in jQuery bug list, i find in IE, ajaxStart return the error NULL, please tell me the bug was closed? and i use 1.0.3, the ajaxStart is not Work. Bug reports are closed as soon as they are fixed. It takes a while to get the change into a new release. You have to check out either the latest revision from SVN or wait till 1.0.4 which should come out pretty soon. If the bug persists, reopen the bug ticket with some testcode showing the problem. -- Jorn Zaefferer http://bassistance.de ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Memory leak
Ethan Hannagan schrieb: Thanks for your reply. I downloaded the latest from SVN and built it, but I still have the same memory leak. Anyhow I still can't figure out where the memory leak is, I'm not sure if it's my code or jQuery. I think it's because you have a circular reference here, created by the closure: function bind() { var p = $(this).find(p); p.click(function(){}); } -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Memory leak
The purpose of the bigString expando is just to create a huge object and make it easier to spot that there's a memory leak. Citrus wrote: I think that the reloadandbind call may be creating a closure that you're not intending. But, that's just me looking at the code for 5 minutes, I might not be seeing it straight. Also, it's a bad idea to stick custom js objects onto DOM objects - specifically bigString. It causes conflicts between IE's two garbage collectors. You should create a js object instead that has a DOM element as a member, and also the custom (bigString) part as a member. foo = { para: p.get(0), bigString: ... } Lastly, while I don't know what effect this has, I'd say that you shouldn't be calling new Array() if you don't have to. I hope that some of this helps. - Brian Thanks for your reply. I downloaded the latest from SVN and built it, but I still have the same memory leak. Anyhow I still can't figure out where the memory leak is, I'm not sure if it's my code or jQuery. Brandon Aaron wrote: Please grab the latest from SVN as it fixes the memory leak in IE. -- Brandon Aaron On 12/11/06, Ethan Hannagan [EMAIL PROTECTED] wrote: Hi, Can you help me spot what is causing the memory leak in the following code? If I click reload, bind, and clean several times, the memory allocation for IE stays still. But if I click in the reload bind and then clean, several times, the memory allocation keeps climbing. I appreciate any feedback you may have. Thanks, Ethan = html head script type=text/javascript src=jquery-1.0.3.js/script meta http-equiv=content-type content=text/html / titleIE Memory Leak/title /head body button id=reloadreload/buttonbr button id=bindbind/buttonbrbr button id=reloadnbindreload bind/buttonbrbr button id=cleanclean!/buttonbr div id=container style=border:1px solid red/div div id=counter style=border:1px solid green/div script type=text/javascript var counter = 1; function reload(callback){ $(#container).load(template.html, callback); } function bind(){ var p = $(this).find(p); p.click(function(){}); p.get(0).bigString = new Array(1000).join(new Array(1000).join(X)); $(#counter).html(counter++); } $(#reload).click(reload); $(#bind).click(bind); $(#reloadnbind).click(function(){ reload(bind); }); $(#clean).click(function(){ var p = $(#container).find(p); p.unbind(); p.get(0).onclick = null; $(#container).html(); }); /script /body /html -- View this message in context: http://www.nabble.com/Memory-leak-tf2792655.html#a7791251 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/Memory-leak-tf2792655.html#a7836682 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/Memory-leak-tf2792655.html#a7837984 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Memory leak
Yes, but when I click on the 'clean' button, Im unbinding and clearing out the event, to avoid memory leak, but somehow the leak is still there. When I click in the clean button, this code gets executed... var p = $(#container).find(p); p.unbind(); p.get(0).onclick = null; $(#container).html(); But I don't know what else I need to clear out to get rid of the memory leak. Klaus Hartl wrote: Ethan Hannagan schrieb: Thanks for your reply. I downloaded the latest from SVN and built it, but I still have the same memory leak. Anyhow I still can't figure out where the memory leak is, I'm not sure if it's my code or jQuery. I think it's because you have a circular reference here, created by the closure: function bind() { var p = $(this).find(p); p.click(function(){}); } -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/Memory-leak-tf2792655.html#a7838041 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] AJAX html fragment
Hello all, I'd like to return something like this from an ajax call: success[html fragment]/success or errorserrorError message/error.../errors Where the html fragment is like div id=fooscript type=application/json{foo: 'bar'}/scriptspanSome stuff.../span/div. I would like to insert the html fragment into my page, but I'm having a really hard time. I think it's a content type issue. When I use text/html, this doesn't work: if($('success', data).size 0) { /* process success */ } But if I use text/xml, when I insert the data into the document, it isn't processing it as html, I just get the plain text even though I can see all the html in the generated source. Could somebody point me in the right direction? Should I just return specially formatted html like div class=success.../div instead of success.../success and use text/html? Thanks, Erik ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] AJAX html fragment
Check out the awesome jXs plugin: http://www.malsup.com/jquery/jxs/ The original http://www.brainknot.com/code/jxs.htm seems to be offline. --Jacob Hello all, I'd like to return something like this from an ajax call: success[html fragment]/success or errorserrorError message/error.../errors Where the html fragment is like div id=fooscript type=application/json{foo: 'bar'}/scriptspanSome stuff.../span/div. I would like to insert the html fragment into my page, but I'm having a really hard time. I think it's a content type issue. When I use text/html, this doesn't work: if($('success', data).size 0) { /* process success */ } But if I use text/xml, when I insert the data into the document, it isn't processing it as html, I just get the plain text even though I can see all the html in the generated source. Could somebody point me in the right direction? Should I just return specially formatted html like div class=success.../div instead of success.../success and use text/html? Thanks, Erik ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] .selectedIndex VS jQuery
Hi I followed the discussions about 'how to make jquery more popular' and I just want to point out that this is the kind of things that should be learned to newcomers in a crash course. $() is easy to understand as a steroid getElementById(), but to understand that it returns a jQuery object belongs more to the innards of jQuery. I'm using for time to time jQuery for 4 months and it is the kind things I'm avid to better understand. get(0) or [1] ok got it, but will each() work ? is there a way to filter ? Well I usually get the answer to such questions by myself, but I'd love to see it discussed on some blogs around with pros and cons, before I even really need it... Ok, maybe I should write a few stuffs by myself before to tell others what to do, but please take this as gentle suggestion, just pointing out... olivvv Klaus Hartl wrote: jazzle schrieb: Why doesn't $(#b6).selectedIndex = $(#s6).selectedIndex; work? (Assuming #b6 and #s6 are similar select boxes of course. Copying billing to shipping address BTW) I know it's not really how jQuery code usually works, but would like to understand why not. What $(#b6) returns is a jQuery object that contains one or more elements (nodes), e.g. the search result of the expression that you passed in. If you want to access DOM properties of an element you have get them out ouf the jQuery object first. This can be done via the get(n) method or with simple Array index notation: var firstElem = $(div).get(0); var secondElem = $(div)[1]; Be careful with that: It may be the case that there is no second element, so if you try to access secondElem (which is undefined in that case) it may throw an error: secondElem.className = 'foo'; // may throw an error In such cases it's better to stick to jQuery methods like each() to prevent such errors. Your example again (untestet): $(#b6).get(0).selectedIndex = $(#s6).get(0).selectedIndex; and more jQuerish (assuming that the value corresponds to the selected index): $('#b6').val( $(#s6).val() ); -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] .selectedIndex VS jQuery
Olivier Percebois-Garve schrieb: Hi I followed the discussions about 'how to make jquery more popular' and I just want to point out that this is the kind of things that should be learned to newcomers in a crash course. $() is easy to understand as a steroid getElementById(), but to understand that it returns a jQuery object belongs more to the innards of jQuery. I'm using for time to time jQuery for 4 months and it is the kind things I'm avid to better understand. get(0) or [1] ok got it, but will each() work ? is there a way to filter ? Well I usually get the answer to such questions by myself, but I'd love to see it discussed on some blogs around with pros and cons, before I even really need it... Ok, maybe I should write a few stuffs by myself before to tell others what to do, but please take this as gentle suggestion, just pointing out... The Getting Started guide mentions it, but not very prominent: http://jquery.bassistance.de/jquery-getting-started.html#find Somewhere around the example with form reset... Do you think it would help the generic newcomer if the guide has more prominent examples and explanations about this issue? -- Jörn Zaefferer http://bassistance.de ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Interface: Resizeable question
Does anyone know how to alter the iresizeable.js file to allow multiple resizeable elements on the page? Right now it seems very dependant on IDs, but I need it to be class based. For example I need the handles in each one of these divs to resize the parent div. Right now it just resizes the last element with the resizeable class on the page. div style= class=phaseWrapper div style=width: 100px class=phase draggable resizeable id=a1 div class=resizeE/div div class=resizeW/div /div /div div style= class=phaseWrapper div style=width: 200px class=phase draggable resizeable id=a2 div class=resizeE/div div class=resizeW/div /div /div Any ideas? I've been staring at the code and I'm clueless on what to change :/ -- View this message in context: http://www.nabble.com/Interface%3A-Resizeable-question-tf2810150.html#a7841608 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] jQuery is now on gotAPI.com!!!
FYI -- for all those that know about http://gotapi.com, jQuery documentation (ver 1.0.3) is now available on their site. If you don't see it under the AJAX and Frameworks section, you may need to refresh your browser cache. Rich ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery is now on gotAPI.com!!!
Very nice indeed! Thanks Rich. Matthew Delmarter Systems Delivery Manager Database Communications _ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rich Manalang Sent: Wednesday, 13 December 2006 10:25 a.m. To: jQuery Discussion. Subject: [jQuery] jQuery is now on gotAPI.com!!! FYI -- for all those that know about http://gotapi.com, jQuery documentation (ver 1.0.3) is now available on their site. If you don't see it under the AJAX and Frameworks section, you may need to refresh your browser cache. Rich ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery is now on gotAPI.com!!!
Awesome job Rich! Rey... Rich Manalang wrote: FYI -- for all those that know about http://gotapi.com, jQuery documentation (ver 1.0.3) is now available on their site. If you don't see it under the AJAX and Frameworks section, you may need to refresh your browser cache. Rich ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Elegant Loading Indicator
I do love the simplicity of this... although I had to modify it for my own purposes :-) // Adds a wait indicator to any ajax requests $(document.body).ajaxStart(function() { $(document.body).append('div id=loadingLoading.../div'); $('#loading').css({padding:2px, fontSize:9pt, position:fixed, top:0, right:0, background:red, color:white}); }).ajaxStop(function() { $('#loading').remove(); }); Rich On 12/8/06, Chris W. Parker [EMAIL PROTECTED] wrote: On Friday, December 08, 2006 2:13 AM Barry Nauta said: For me, the wait cursor indicates an upcoming page refresh (oldschool web?), hence I will probably wait for this cursor to disappear before doing anything else. The beauty of Ajax (one of) IMHO is that you can continue to work on a page... Good point. In this case then the author can use the arrow+hour glass icon. For sure this is available on Windows but I'm not sure about Linux and OSX. Chris. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Elegant Loading Indicator
That can be optimized too: $(document.body).ajaxStart(function() { $(div id=loadingLoading.../div).appendTo(document.body).css({padding:2px, fontSize:9pt, position:fixed, top:0, right:0, background:red, color:white}); }).ajaxStop(function() { $('#loading').remove(); }); On 12/12/06, Rich Manalang [EMAIL PROTECTED] wrote: I do love the simplicity of this... although I had to modify it for my own purposes :-) // Adds a wait indicator to any ajax requests $(document.body).ajaxStart(function() { $(document.body).append('div id=loadingLoading.../div'); $('#loading').css({padding:2px, fontSize:9pt, position:fixed, top:0, right:0, background:red, color:white}); }).ajaxStop(function() { $('#loading').remove(); }); Rich On 12/8/06, Chris W. Parker [EMAIL PROTECTED]https://mail.google.com/mail?view=cmtf=0[EMAIL PROTECTED] wrote: On Friday, December 08, 2006 2:13 AM Barry Nauta said: For me, the wait cursor indicates an upcoming page refresh (oldschool web?), hence I will probably wait for this cursor to disappear before doing anything else. The beauty of Ajax (one of) IMHO is that you can continue to work on a page... Good point. In this case then the author can use the arrow+hour glass icon. For sure this is available on Windows but I'm not sure about Linux and OSX. Chris. ___ jQuery mailing list discuss@jquery.comhttps://mail.google.com/mail?view=cmtf=0[EMAIL PROTECTED] http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.comhttps://mail.google.com/mail?view=cmtf=0[EMAIL PROTECTED] http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] .selectedIndex VS jQuery
$() is easy to understand as a steroid getElementById(), but to understand that it returns a jQuery object belongs more to the innards of jQuery. I'm using for time to time jQuery for 4 months and it is the kind things I'm avid to better understand. Do you think it would help the generic newcomer if the guide has more prominent examples and explanations about this issue? This could be automatically checked by the debug plugin, at least when used with Firefox and Firebug. John's original debug plugin wraps each method, but you could also have getter/setter methods that warned when someone tried $().disabled = true for instance. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Elegant Loading Indicator
that's fine too... but you still need to trigger the loading indicator to show up when an ajax request goes out. On 12/12/06, Andy Matthews [EMAIL PROTECTED] wrote: Why not just create the style for the loading bar in your stylesheet? Then you don't have to do that in jQuery. !//-- andy matthews web developer certified advanced coldfusion programmer ICGLink, Inc. [EMAIL PROTECTED] 615.370.1530 x737 --//- -Original Message- *From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of *Rich Manalang *Sent:* Tuesday, December 12, 2006 3:59 PM *To:* jQuery Discussion. *Subject:* Re: [jQuery] Elegant Loading Indicator I do love the simplicity of this... although I had to modify it for my own purposes :-) // Adds a wait indicator to any ajax requests $(document.body).ajaxStart(function() { $(document.body).append('div id=loadingLoading.../div'); $('#loading').css({padding:2px, fontSize:9pt, position:fixed, top:0, right:0, background:red, color:white}); }).ajaxStop(function() { $('#loading').remove(); }); Rich On 12/8/06, Chris W. Parker [EMAIL PROTECTED] wrote: On Friday, December 08, 2006 2:13 AM Barry Nauta said: For me, the wait cursor indicates an upcoming page refresh (oldschool web?), hence I will probably wait for this cursor to disappear before doing anything else. The beauty of Ajax (one of) IMHO is that you can continue to work on a page... Good point. In this case then the author can use the arrow+hour glass icon. For sure this is available on Windows but I'm not sure about Linux and OSX. Chris. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] draggable tree IE positioning
In IE, dropping a droppable causes its children to be treated as though they were several ems off their actual positions. Examples: http://interface.eyecon.ro/demos/drag_drop_tree.html http://bluej.freeshell.org/jquery/asset_drag On both of these pages, if you drag Folder A into Folder B and then try to drag something into Folder A, you will have to release it somewhere to the right of and perhaps below its actual position. Likewise, if you drag Folder A into Folder B and then pick up one of the draggables in Folder A, it will appear to jump into a similar position. I'm looking at idrag.js and idrop.js trying to figure out a patch, but I'm not even sure where to start. Do any of you have any ideas? -- View this message in context: http://www.nabble.com/draggable-tree-IE-positioning-tf2810573.html#a7843066 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Elegant Loading Indicator
Yep... !//-- andy matthews web developer certified advanced coldfusion programmer ICGLink, Inc. [EMAIL PROTECTED] 615.370.1530 x737 --//- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Rich Manalang Sent: Tuesday, December 12, 2006 4:21 PM To: jQuery Discussion. Subject: Re: [jQuery] Elegant Loading Indicator that's fine too... but you still need to trigger the loading indicator to show up when an ajax request goes out. On 12/12/06, Andy Matthews [EMAIL PROTECTED] wrote: Why not just create the style for the loading bar in your stylesheet? Then you don't have to do that in jQuery. !//-- andy matthews web developer certified advanced coldfusion programmer ICGLink, Inc. [EMAIL PROTECTED] 615.370.1530 x737 --//- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Rich Manalang Sent: Tuesday, December 12, 2006 3:59 PM To: jQuery Discussion. Subject: Re: [jQuery] Elegant Loading Indicator I do love the simplicity of this... although I had to modify it for my own purposes :-) // Adds a wait indicator to any ajax requests $(document.body).ajaxStart(function() { $(document.body).append('div id=loadingLoading.../div'); $('#loading').css({padding:2px, fontSize:9pt, position:fixed, top:0, right:0, background:red, color:white}); }).ajaxStop(function() { $('#loading').remove(); }); Rich On 12/8/06, Chris W. Parker [EMAIL PROTECTED] wrote: On Friday, December 08, 2006 2:13 AM Barry Nauta said: For me, the wait cursor indicates an upcoming page refresh (oldschool web?), hence I will probably wait for this cursor to disappear before doing anything else. The beauty of Ajax (one of) IMHO is that you can continue to work on a page... Good point. In this case then the author can use the arrow+hour glass icon. For sure this is available on Windows but I'm not sure about Linux and OSX. Chris. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery is now on gotAPI.com!!!
Great job Rich. http://jquery.com/blog/2006/12/12/jquery-v103-api-docs-on-gotapicom/ Rey... Rich Manalang wrote: FYI -- for all those that know about http://gotapi.com, jQuery documentation (ver 1.0.3) is now available on their site. If you don't see it under the AJAX and Frameworks section, you may need to refresh your browser cache. Rich ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] this verus (this)
Why do I need to wrap the this with $(this) - (when using $('#...').each) - why isnt' that done automatically? -- View this message in context: http://www.nabble.com/this-verus-%28this%29-tf2810909.html#a7843947 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] this verus (this)
On Dec 12, 2006, at 6:07 PM, SRobertJames wrote: Why do I need to wrap the this with $(this) - (when using $ ('#...').each) - why isnt' that done automatically? Hi Robert, Actually, I just mentioned this in my blog entry last night: http://www.learningjquery.com/2006/12/multiple-fancy-drop-caps Basically, You would continue to use $(this) if you wanted to apply jQuery methods to it. If you wanted to refer to the DOM elements themselves, you would use this I'm sure someone else can go into greater detail about this, but I'm pretty sure that at its basic level it's the difference between using a jQuery object and using a DOM node. Karl ___ Karl Swedberg www.englishrules.com www.learningjquery.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] this verus (this)
'this' refers to the actual DOM element, and you can get things just like normal JS (this.innerHTML, etc). Using '$(this)' wraps jQuery back around it, so you can use functions like slideUp and the like.. A lot of the time you wont need jquery to accomplish something. On 12/12/06, SRobertJames [EMAIL PROTECTED] wrote: Why do I need to wrap the this with $(this) - (when using $('#...').each) - why isnt' that done automatically? -- View this message in context: http://www.nabble.com/this-verus-%28this%29-tf2810909.html#a7843947 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] this verus (this)
Since jQueryizing an element - involves a small performance hit and - not every developer's requires a jQuery object in eqch it makes more sense to simply provide the element itself inside each. This way developers can do $(this) if they need to. Blair On 12/13/06, SRobertJames [EMAIL PROTECTED] wrote: Why do I need to wrap the this with $(this) - (when using $('#...').each) - why isnt' that done automatically? -- View this message in context: http://www.nabble.com/this-verus-%28this%29-tf2810909.html#a7843947 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] this verus (this)
...you would have to do $(this)[0], so it's extra typing either way. ... Er in that example it should be this[0]. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] .selectedIndex VS jQuery
Jörn Zaefferer wrote: Olivier Percebois-Garve schrieb: Hi I followed the discussions about 'how to make jquery more popular' and I just want to point out that this is the kind of things that should be learned to newcomers in a crash course. $() is easy to understand as a steroid getElementById(), but to understand that it returns a jQuery object belongs more to the innards of jQuery. I'm using for time to time jQuery for 4 months and it is the kind things I'm avid to better understand. get(0) or [1] ok got it, but will each() work ? is there a way to filter ? Well I usually get the answer to such questions by myself, but I'd love to see it discussed on some blogs around with pros and cons, before I even really need it... Ok, maybe I should write a few stuffs by myself before to tell others what to do, but please take this as gentle suggestion, just pointing out... The Getting Started guide mentions it, but not very prominent: http://jquery.bassistance.de/jquery-getting-started.html#find Somewhere around the example with form reset... Do you think it would help the generic newcomer if the guide has more prominent examples and explanations about this issue? Well yes. Generally speaking this among the things where the framework is extending the language. Chaining seemed to be one of the aspects of jquery that peoples seemed like the most, but I did not found a lot of literature about it. What is or is not possible in a chain ? how to optimize it ? When is the 'e' param in blabla(function(e){ necessary ? Documentation is great, but is kinda like an encyclopedia, I does not really explain the logic. As any framework jquery builds complex data structures in a snap, and provides useful methods to handle it. As an intermediate developer I had no problem coding rollovers before jquery, so even if the code is neater with jquery, that's not the point of my choice of it. I believe I'll have a wahoo! effect with any frameworks because I can code in 3 lines some stuffs that move but the issue to me is more about how to code in 50 lines what would have taken 500. I KNOW jquery can do it, but if I run into weird issues, I also know it may be more difficult than normal coding because I'll understand less what is happening under the hood of jquery than what is in my code. I am promoting jquery to a co-worker who has written a big Prototype based application. I could not explain him exactly what was the type of the data he was handling, nor how to do a closure to avoid conflict with prototype (what I saw in your? tooltip). It seems little code to do, but... in my company we cannot spent 3-4 hours understanding something, time needs to be justified, so he made it old school quick and dirty. I am a php/javascript coder and used to care little about typing. What I see with frameworks (cakephp for php and jquery for js) is that they lead me to manipulate more complex data structures where type become really important. Am I going off topic ? So to sum up: jquery objects - chaining - closures That's the stuffs I wanna to master in order to claim that I really feel confident with jquery. Now let's go back to your article... olivvv ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] .selectedIndex VS jQuery
I think the two most confusing and frustrating things for jQuery beginners (speaking as one myself) are these: 1) Needing to use the $() operator in every statement, even if you're referring to a variable which you got from a jQuery call in the first place, as SRobertJames has mentioned ( http://www.nabble.com/this-verus-%28this%29-tf2810909.html ). 2) Not being able to use standard DOM methods on elements returned by a jQuery call, even if you reduce it to one with an #id specification or an eq(0). I wasn't aware of get(0) before, and this made me feel like I had to learn an entire new language, quirks and all, to take advantage of jQuery's features. Please don't take this as snarky. I've really enjoyed working with the library, and I'm trying to be helpful. Jörn Zaefferer wrote: Olivier Percebois-Garve schrieb: Hi I followed the discussions about 'how to make jquery more popular' and I just want to point out that this is the kind of things that should be learned to newcomers in a crash course. $() is easy to understand as a steroid getElementById(), but to understand that it returns a jQuery object belongs more to the innards of jQuery. The Getting Started guide mentions it, but not very prominent: http://jquery.bassistance.de/jquery-getting-started.html#find Somewhere around the example with form reset... Do you think it would help the generic newcomer if the guide has more prominent examples and explanations about this issue? -- Jörn Zaefferer http://bassistance.de ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/.selectedIndex-VS-jQuery-tf2806806.html#a7844427 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] this verus (this)
Hi, Why do I need to wrap the this with $(this) - (when using $('#...').each) - why isnt' that done automatically? Most of the time you use each(), because you want to access the DOM Objects. That is exactly what you get as this. In most cases you need a jQuery Object you can do your work outside of each(). Christof ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] .selectedIndex VS jQuery
Well yes. Generally speaking this among the things where the framework is extending the language. Chaining seemed to be one of the aspects of jquery that peoples seemed like the most, but I did not found a lot of literature about it. What is or is not possible in a chain ? how to optimize it ? When is the 'e' param in blabla(function(e){ necessary ? Documentation is great, but is kinda like an encyclopedia, I does not really explain the logic. As any framework jquery builds complex data structures in a snap, and provides useful methods to handle it. As an intermediate developer I had no problem coding rollovers before jquery, so even if the code is neater with jquery, that's not the point of my choice of it. I believe I'll have a wahoo! effect with any frameworks because I can code in 3 lines some stuffs that move but the issue to me is more about how to code in 50 lines what would have taken 500. I KNOW jquery can do it, but if I run into weird issues, I also know it may be more difficult than normal coding because I'll understand less what is happening under the hood of jquery than what is in my code. I am promoting jquery to a co-worker who has written a big Prototype based application. I could not explain him exactly what was the type of the data he was handling, nor how to do a closure to avoid conflict with prototype (what I saw in your? tooltip). It seems little code to do, but... in my company we cannot spent 3-4 hours understanding something, time needs to be justified, so he made it old school quick and dirty. I am a php/javascript coder and used to care little about typing. What I see with frameworks (cakephp for php and jquery for js) is that they lead me to manipulate more complex data structures where type become really important. Am I going off topic ? So to sum up: jquery objects - chaining - closures That's the stuffs I wanna to master in order to claim that I really feel confident with jquery. Now let's go back to your article... olivvv Talking of this and what is needed for getjquery.org I just read an interesting article about what a JS library should provide: http://www.webstandards.org/2006/12/12/reducing-the-pain-of-adopting-a-javascript-library/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery is now on gotAPI.com!!!
Great job! manalang wrote: FYI -- for all those that know about http://gotapi.com, jQuery documentation (ver 1.0.3) is now available on their site. If you don't see it under the AJAX and Frameworks section, you may need to refresh your browser cache. Rich ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/jQuery-is-now-on-gotAPI.com%21%21%21-tf2810300.html#a7844928 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] IE6 fadeIn/fadeOut Problem (css prob?)
Brandon Aaron wrote: On 12/9/06, Brice Burgess [EMAIL PROTECTED] wrote: Glen Lipka wrote: I didn't analyze the whole thing, but just a quick question: Have you considered using the fadeTo() function? it works better than messing with the opacity in the CSS. Glen In jQ 1.0.3 + you can also use $('#el').css('opacity',0.5); which is similar to $('#el').fadeTo(1,0.5); except that it doesn't give the element layout to make it compatible with $.anim() routines. The css opacity method doesn't allow you to fade over time, however -- though it is cleaner IMO. Anytime you set the opacity of an element in IE, the element is given layout. -- Brandon Aaron True.. but I'm not refering to the has layout IE attribute -- more so to the box layout it seems to apply. E.g. try using $.fadeTo() / $.hide()+$.show() or any of the other functions which call the $.anim() functions on an inline element. It won't be inline for long? :) ~ Brice ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Using JQuery to manipulate href (URL params)
I'd like to use JQuery to hook up a check box to flip a URL param in a bunch of hrefs. The href would either be 'http://myapp/do/this?id=3sendAlert=1' or http://myapp/do/this?id=3sendAlert=0' Something like: $('#sendAlert').change(function() { sendAlert = (this.checked ? '1' : '0') ; $('#panel a').href.removeTheSendAlert - not sure how to do this $('#panel a').href.append('sendAlert=' + sendAlert); The two problems I'm having are: 1. What is the code to remove the old param of sendAlert (you can assume that it's at the end)? 2. How do I use JQuery to manipulate hrefs? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Is it a bug
Johnny wrote: it works in IE, it can display html created by the xml_to_page.jsp , but it doesn't display in FireFox, and i use DOM Inspect, the div#test actually have content. Johnny, Does: $().ready(function() { $(div#test).load(xml_to_page.jsp,{class:Img,sn:1}).show(); }); Fix show the content? Maybe there's a CSS rule hiding the div? ~ Brice ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Using JQuery to manipulate href (URL params)
// there are rumblings of romoving the event shortcuts (eg $().change) // not sure if change works on a checkbox, if not click should work $('#sendAlert').bind(change,function(){ // find all links in #panel and apply a function to each one $(#panel a).each(function(){ // within each 'this' refers to the element object // not sure if the regex is right this.href=this.href.replace(/sendAlert=[\d]+/,sendAlert=+( this.checked?1:0)); }); }); Blair On 12/13/06, Robert James [EMAIL PROTECTED] wrote: I'd like to use JQuery to hook up a check box to flip a URL param in a bunch of hrefs. The href would either be 'http://myapp/do/this?id=3sendAlert=1' or http://myapp/do/this?id=3sendAlert=0' Something like: $('#sendAlert').change(function() { sendAlert = (this.checked ? '1' : '0') ; $('#panel a').href.removeTheSendAlert - not sure how to do this $('#panel a').href.append('sendAlert=' + sendAlert); The two problems I'm having are: 1. What is the code to remove the old param of sendAlert (you can assume that it's at the end)? 2. How do I use JQuery to manipulate hrefs? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] http://www.acko.net/blog/jquery-menu-scout -- jQuery Menu Scout
saw this today, about jquery on drupal.org! And here's an actually useful mail about this: it's a tool that uses an ajax live-search to fetch matching pages in the Drupal Administration UI (back end). It then dims the page and highlights any links that lead directly or indirectly to the results, with a nice styled bubble. The idea is to make it easier to learn how the Drupal UI works and where certain settings are located. Video at: http://acko.net/files/Drupal%20Menu%20Scout.mp4 Clickable link to blog post: http://www.acko.net/blog/jquery-menu-scout Steven Wittens ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] .selectedIndex VS jQuery
jquery objects - chaining - closures That's the stuffs I wanna to master in order to claim that I really feel confident with jquery. The key here is that you really do need to understand javascript. jQuery is a javascript library. It uses objects and closures. It manages the dom and events. It provides effects and ajax functionality. But all of this is possible without jQuery. The beauty and power of jQuery is that it makes these things easy. But you must still understand what they are and how they work. You need to understand scoping rules, scope chains, and closures. You need to understand the DOM. You need to understand these things not because you're using jQuery but because you're programming in javascript. And if you feel like you're already at that level then dig right in and look at the jQuery source code. It is a great example of how to write good javascript and it's well-documented too. Don't treat the source like a black-box. Regarding the jQuery object. It's just an object. Like Date or Array. It encapsulates zero or more DOM nodes and lets you manipulate those nodes using the jQuery API. $ is the shorthand notation for the jQuery object. Regarding chaining - Yes, jQuery's chaining is great. But jQuery didn't invent chaining. It's just an OO programming concept that's been around for ages. You'll find that most jQuery methods return 'this' which means they return the jQuery object. That lets you keep calling more functions like this: $('.myClass').func1().func2().func3(). Without chaining you'd have to write: var jq = $('.myClass'); jq.func1(); jq.func2(); jq.func3(); That's the whole idea behind chaining. The documentation is quite good so if you want to know if a method is chainable, just look it up in the docs. If it returns a jQuery object then it's chainable. Sorry to ramble on so long. Good luck! ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery is now on gotAPI.com!!!
FYI -- for all those that know about http://gotapi.com, jQuery documentation Excellent, Rich. Looks great. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Disabling a tags
Joan Piedra wrote: On 12/12/06, *Aaron Heimlich* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: div#myid = SLOW!! #myid = FAST!! .myclass = SLOW!! div.myclass = FAST(er)!! LOL, I think this is how it works in real CSS. div#myid = Faster #myid = Slow .myclass = Slow div.myclass = Fast Does anyone know of CSS best practice benchmarks? Is div#myid indeed faster in CSS? ~ Brice ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] How to detect an element's class name?
Dear All, I'm a newbie of jQuery, I got a problem,can anyone give me a hand? My problem is: How can i get the class name of an element? ┈ 国忠 -Terry Luo - UED,Yahoo! China ┈ ・Y!messenger: lovinglgz ・Email: [EMAIL PROTECTED] ・Tel: +86 10 6598 5997 ・Mobile: +86 1358 152 3051 ┈ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to detect an element's class name?
Actually getting the class value isn't as usefull as it might seem at first glance because elements can have multiple classes - i.e. div class=note selected mouseover/div. This means that if you did get the value, you'd have to do all sorts of gymnastics to check for what you want. It's much better to use the functions built into jQuery. To check if an element has a given class: $(#someelementid).is(.yourclass) If you have a list of elements, but only want the ones with a given class: $(div).filter(.yourclass) Blair On 12/13/06, luogz [EMAIL PROTECTED] wrote: Dear All, I'm a newbie of jQuery, I got a problem,can anyone give me a hand? My problem is: How can i get the class name of an element? ┈ 国忠 -Terry Luo - UED,Yahoo! China ┈ ・Y!messenger: lovinglgz ・Email: [EMAIL PROTECTED] ・Tel: +86 10 6598 5997 ・Mobile: +86 1358 152 3051 ┈ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] jQuery 1.0.4 Released
Hi Everyone - Another fantastic release of jQuery is ready for your consumption. This release includes a number of bug fixes (as usual) along with some much-needed improvements to jQuery's Ajax functionality. As always, if you have any questions or concerns with new release, please feel free to discuss it on the mailing list. If you think you've spotted a bug, please add it to the bug tracker (http://jquery.com/dev/bugs/new/). So, without further ado, here's jQuery 1.0.4: Download - Compressed JavaScript (Recommended Download!) http://jquery.com/src/jquery-1.0.4.pack.js - Uncompressed JavaScript http://jquery.com/src/jquery-1.0.4.js - 1.0.4 Documentation http://jquery.com/api/ - 1.0.4 Test Suite http://jquery.com/test/ - Full Release (jQuery, Test Suite, Documentation) http://jquery.com/src/jquery-1.0.4.release.zip - Build Files (Compile your own version of jQuery 1.0.4) http://jquery.com/src/jquery-1.0.4.build.zip Changes and Features - Tons of bug fixes Full List: http://jquery.com/dev/bugs/10/?sort=ticketasc=0 - Extensions to $.ajax(): $.ajax accepts additional options: beforeSend, async and processData; returns XMLHttpRequest to allow manual aborting of requests, see docs for details. Example: Add extra headers to an Ajax request using beforeSend $.ajax({ type: POST, url: /files/add/, beforeSend: function(xhr) { xhr.setRequestHeader( Content-type, text/plain ); }, data: This is the contents of my text file. }); Example: Perform a synchronous Ajax request. // Get the HTML of a web page and save it // to a variable (the browser will freeze until the // entire request is completed). var html = $.ajax({ type: GET, url: test.html, async: false }).responseText; // Add the HTML into the page $(#list).html( html ); Example: Sending a JavaScript object using processData. // The data to send to the server var params = { name: John, city: Boston }; $.ajax({ type: POST, url: /user/add/, processData: params }); Example: Aborting an Ajax request after a specific delay in time. // Perform a simple Ajax request var req = $.ajax({ type: GET, url: /user/list/, success: function(data) { // Do something with the data... // Then remove the request. req = null; } }); // Wait for 5 seconds setTimeout(function(){ // If the request is still running, abort it. if ( req ) req.abort(); }, 5000); - AJAX module: The public $.ajax API is now used internally (for $.get/$.post etc.); loading scripts works now much more reliably in all browsers (with the exception of Safari, which is a work in progress). - New global Ajax handler: ajaxSend - called before an Ajax request is sent. Example: Add extra headers to all Ajax requests using the ajaxSend event. $(document).ajaxSend(function(xhr){ xhr.setRequestHeader(X-Web-Request, MySite.com); }); Extensions to global Ajax handlers: ajaxSend, ajaxSuccess, ajaxError and ajaxComplete get XMLHttpRequest and settings passed as arguments. Example: Prevent any POST requests that are sending too much data. $(document).ajaxSend(function(xhr,options){ if ( options.type == POST options.data.length 1024 ) xhr.abort(); }); Example: Show a special message for requests submitted using an Ajax POST. $(#dataSent).ajaxSend(function(xhr,options){ if ( options.type == POST ) $(this).show(); }); Extensions to event handling: pageX and pageY are available in all browsers now. (IE does not provide native pageX/Y). Example: Have a tooltip follow a user's mouse around the page. $(document).mousemove(function(e){ $(#mousetip).css({ top: e.pageY + px, left: e.pageX + px }); }); Improved docs: $(String) method has now two separate descriptions, one for selecting elements, one for creating html on-the-fly. FX module: Most inline styles added by animations are now removed when the animation is complete, eg. height style when animating height (exception: display styles). (This message can also be found here: http://jquery.com/blog/2006/12/12/jquery-104/) --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to detect an element's class name?
hi, p class=abc $(.abc) or $(p.abc) you'd better to see the jquery api document:) Johnny On 12/13/06, luogz [EMAIL PROTECTED] wrote: Dear All, I'm a newbie of jQuery, I got a problem,can anyone give me a hand? My problem is: How can i get the class name of an element? ┈ 国忠 -Terry Luo - UED,Yahoo! China ┈ ・Y!messenger: lovinglgz ・Email: [EMAIL PROTECTED] ・Tel: +86 10 6598 5997 ・Mobile: +86 1358 152 3051 ┈ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] .selectedIndex VS jQuery
This needs to be post somewhere on the jQuery site and getjquery.org very prominently. Excellent post Mike (damn, man you're on a roll!). On 12/12/06, Mike Alsup [EMAIL PROTECTED] wrote: jquery objects - chaining - closures That's the stuffs I wanna to master in order to claim that I really feel confident with jquery. The key here is that you really do need to understand javascript. jQuery is a javascript library. It uses objects and closures. It manages the dom and events. It provides effects and ajax functionality. But all of this is possible without jQuery. The beauty and power of jQuery is that it makes these things easy. But you must still understand what they are and how they work. You need to understand scoping rules, scope chains, and closures. You need to understand the DOM. You need to understand these things not because you're using jQuery but because you're programming in javascript. And if you feel like you're already at that level then dig right in and look at the jQuery source code. It is a great example of how to write good javascript and it's well-documented too. Don't treat the source like a black-box. Regarding the jQuery object. It's just an object. Like Date or Array. It encapsulates zero or more DOM nodes and lets you manipulate those nodes using the jQuery API. $ is the shorthand notation for the jQuery object. Regarding chaining - Yes, jQuery's chaining is great. But jQuery didn't invent chaining. It's just an OO programming concept that's been around for ages. You'll find that most jQuery methods return 'this' which means they return the jQuery object. That lets you keep calling more functions like this: $('.myClass').func1().func2().func3(). Without chaining you'd have to write: var jq = $('.myClass'); jq.func1(); jq.func2(); jq.func3(); That's the whole idea behind chaining. The documentation is quite good so if you want to know if a method is chainable, just look it up in the docs. If it returns a jQuery object then it's chainable. Sorry to ramble on so long. Good luck! ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery 1.0.4 Released
Congratulations on this. I can honestly say that jQuery has literally revolutionized the way I write javascript. I had played around with prototype/behaviour, and was just about to start using it on a big project when I came across jQuery. I really can't imagine the nightmare that it would have been had we not had jQuery. You can expect a Christmas bonus from us in the next few days. --Erik On 12/12/06, John Resig [EMAIL PROTECTED] wrote: Hi Everyone - Another fantastic release of jQuery is ready for your consumption. This release includes a number of bug fixes (as usual) along with some much-needed improvements to jQuery's Ajax functionality. As always, if you have any questions or concerns with new release, please feel free to discuss it on the mailing list. If you think you've spotted a bug, please add it to the bug tracker (http://jquery.com/dev/bugs/new/). So, without further ado, here's jQuery 1.0.4: Download - Compressed JavaScript (Recommended Download!) http://jquery.com/src/jquery-1.0.4.pack.js - Uncompressed JavaScript http://jquery.com/src/jquery-1.0.4.js - 1.0.4 Documentation http://jquery.com/api/ - 1.0.4 Test Suite http://jquery.com/test/ - Full Release (jQuery, Test Suite, Documentation) http://jquery.com/src/jquery-1.0.4.release.zip - Build Files (Compile your own version of jQuery 1.0.4) http://jquery.com/src/jquery-1.0.4.build.zip Changes and Features - Tons of bug fixes Full List: http://jquery.com/dev/bugs/10/?sort=ticketasc=0 - Extensions to $.ajax(): $.ajax accepts additional options: beforeSend, async and processData; returns XMLHttpRequest to allow manual aborting of requests, see docs for details. Example: Add extra headers to an Ajax request using beforeSend $.ajax({ type: POST, url: /files/add/, beforeSend: function(xhr) { xhr.setRequestHeader( Content-type, text/plain ); }, data: This is the contents of my text file. }); Example: Perform a synchronous Ajax request. // Get the HTML of a web page and save it // to a variable (the browser will freeze until the // entire request is completed). var html = $.ajax({ type: GET, url: test.html, async: false }).responseText; // Add the HTML into the page $(#list).html( html ); Example: Sending a JavaScript object using processData. // The data to send to the server var params = { name: John, city: Boston }; $.ajax({ type: POST, url: /user/add/, processData: params }); Example: Aborting an Ajax request after a specific delay in time. // Perform a simple Ajax request var req = $.ajax({ type: GET, url: /user/list/, success: function(data) { // Do something with the data... // Then remove the request. req = null; } }); // Wait for 5 seconds setTimeout(function(){ // If the request is still running, abort it. if ( req ) req.abort(); }, 5000); - AJAX module: The public $.ajax API is now used internally (for $.get/$.post etc.); loading scripts works now much more reliably in all browsers (with the exception of Safari, which is a work in progress). - New global Ajax handler: ajaxSend - called before an Ajax request is sent. Example: Add extra headers to all Ajax requests using the ajaxSend event. $(document).ajaxSend(function(xhr){ xhr.setRequestHeader(X-Web-Request, MySite.com); }); Extensions to global Ajax handlers: ajaxSend, ajaxSuccess, ajaxError and ajaxComplete get XMLHttpRequest and settings passed as arguments. Example: Prevent any POST requests that are sending too much data. $(document).ajaxSend(function(xhr,options){ if ( options.type == POST options.data.length 1024 ) xhr.abort(); }); Example: Show a special message for requests submitted using an Ajax POST. $(#dataSent).ajaxSend(function(xhr,options){ if ( options.type == POST ) $(this).show(); }); Extensions to event handling: pageX and pageY are available in all browsers now. (IE does not provide native pageX/Y). Example: Have a tooltip follow a user's mouse around the page. $(document).mousemove(function(e){ $(#mousetip).css({ top: e.pageY + px, left: e.pageX + px }); }); Improved docs: $(String) method has now two separate descriptions, one for selecting elements, one for creating html on-the-fly. FX module: Most inline styles added by animations are now removed when the animation is complete, eg. height style when animating height (exception: display styles). (This message can also be found here: http://jquery.com/blog/2006/12/12/jquery-104/) --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery 1.0.4 Released
So, without further ado, here's jQuery 1.0.4: Fantastic! Thanks, John. And special thanks to Jörn for this tireless efforts and to Brandon as well. You guys are really doing great work. Mike ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] this verus (this)
I see. Thanks for the clarification. As a newcomer, I will say that this should be shown in the docs/examples. I had to undergo a lot of trial, error, and head scratching before I figured this out. (I don't think any of the docs for $().each() show this). BTW, what things do you need the DOM ,Object for, that you can't use the JQ Object? Why? On 12/12/06, Christof Donat [EMAIL PROTECTED] wrote: Hi, Why do I need to wrap the this with $(this) - (when using $('#...').each) - why isnt' that done automatically? Most of the time you use each(), because you want to access the DOM Objects. That is exactly what you get as this. In most cases you need a jQuery Object you can do your work outside of each(). Christof ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery 1.0.4 Released
I'm new to JQuery, but so far, it's out of this world! ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] this verus (this)
DOM is alot quicker. On 12/12/06, Robert James [EMAIL PROTECTED] wrote: I see. Thanks for the clarification. As a newcomer, I will say that this should be shown in the docs/examples. I had to undergo a lot of trial, error, and head scratching before I figured this out. (I don't think any of the docs for $().each() show this). BTW, what things do you need the DOM ,Object for, that you can't use the JQ Object? Why? On 12/12/06, Christof Donat [EMAIL PROTECTED] wrote: Hi, Why do I need to wrap the this with $(this) - (when using $('#...').each) - why isnt' that done automatically? Most of the time you use each(), because you want to access the DOM Objects. That is exactly what you get as this. In most cases you need a jQuery Object you can do your work outside of each(). Christof ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Efforts to Convert Folks to jQuery
http://www.openajax.org/about.html anyone interested in joinging the opn ajax alliance. I think the fact that jquery can run with prototype shows that it is willing to work well with others. and every little bit of press helps ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] this verus (this)
Generally the jQ object has methods that - can apply to the entire selected array of elements. Some extra methods are included for completeness - e.g. attr(href,#) sets the href attribute on all selected elements, but attr(href) will return the href value of the first selected element. - extend the DOM object functionality (e.g. all the traversal methods - find, parents, siblings, filter), are really convenient (e.g. hide - basically just sets style.display=hidden on a bunch of elements), or encapsulate complex code in a simple method (e.g. load - uses ajax to load a web page and puts it in the selected elements) As Matt said, DOM by itself is a lot faster, so if you don't need the extra jQ stuff it's better to not use it. Blair On 12/13/06, Robert James [EMAIL PROTECTED] wrote: I see. Thanks for the clarification. As a newcomer, I will say that this should be shown in the docs/examples. I had to undergo a lot of trial, error, and head scratching before I figured this out. (I don't think any of the docs for $().each() show this). BTW, what things do you need the DOM ,Object for, that you can't use the JQ Object? Why? On 12/12/06, Christof Donat [EMAIL PROTECTED] wrote: Hi, Why do I need to wrap the this with $(this) - (when using $('#...').each) - why isnt' that done automatically? Most of the time you use each(), because you want to access the DOM Objects. That is exactly what you get as this. In most cases you need a jQuery Object you can do your work outside of each(). Christof ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Is it a bug
nope, it display correctly in ie, but it doesn't display in firefox. it must not be the problem of css Brice Burgess wrote: Johnny wrote: it works in IE, it can display html created by the xml_to_page.jsp , but it doesn't display in FireFox, and i use DOM Inspect, the div#test actually have content. Johnny, Does: $().ready(function() { $(div#test).load(xml_to_page.jsp,{class:Img,sn:1}).show(); }); Fix show the content? Maybe there's a CSS rule hiding the div? ~ Brice ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/Is-it-a-bug-tf2805700.html#a7846989 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Efforts to Convert Folks to jQuery
I think thats a question that John would need to answer since he's leading the jQuery effort. Rey... Scottus wrote: http://www.openajax.org/about.html anyone interested in joinging the opn ajax alliance. I think the fact that jquery can run with prototype shows that it is willing to work well with others. and every little bit of press helps ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Att: jQuery marketers - JavaScript Library discussion at WASP
Hi all, Just want to point out that there is a post from Mike Davies at http://www.webstandards.org/2006/12/12/reducing-the-pain-of-adopting- a-javascript-library/ which refers to Chris Heilmann's post here http://www.wait-till-i.com/index.php?p=366 and discusses the difficulty in adopting a new JavaScript library. I think it would be good for the relevant people to follow and possibly chime in on. Joel. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Efforts to Convert Folks to jQuery
I don't have time to sift through this thread, but I just want to say I gave a talk about Drupal jQuery twice in September and got nothing but good replies. The slides are online. Mail me if you want the Apple Keynote file: http://www.acko.net/blog/jquery-drupalcon-talk There is also a video on Google Video, search for jquery drupalcon or so. My slide about why jQuery? says: jQuery •Doesn’t mess with the language (Prototype) •Doesn’t try to be Python (Mochikit) •Only essentials: 15KB (Scriptaculous, Dojo) •More than cosmetic effects (Moo.fx) •Makes common tasks easy :) Steven Wittens ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery is now on gotAPI.com!!!
manalang wrote: FYI -- for all those that know about http://gotapi.com, jQuery documentation (ver 1.0.3) is now available on their site. If you don't see it under the AJAX and Frameworks section, you may need to refresh your browser cache. for the ones that don't really like the common interface there is http://start.gotapi.com. -- David Duymelinck [EMAIL PROTECTED] ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/