Re: [jQuery] Autocomplete invasion
On 8/29/06, Stefan Petre [EMAIL PROTECTED] wrote: Dylan Verheul wrote: Stefan, your plugin also seems to be missing the ability to search on a part of the result that is not at the beginning of the line. Example: if I would search for continents (let's say possible results: North America, South America, Europe, Africa, Asia, Australia), and started typing am, I'd want both America's to show up. 8 snip 8 In the example you search by country name, not the continent list. So the ajax backend searches only there and only the beginning I understand how the example works. It's just that if you want to have a real world autocomplete, you should take into account real world uses. If your backend searches inside the text instead of only the beginning, and you implement caching, you'll need a javascript search to imitate the backend. You can see an example in my autocompleter. http://www.dyve.net/jquery?autocomplete ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Autocomplete invasion
Dylan Verheul wrote: On 8/29/06, Stefan Petre [EMAIL PROTECTED] wrote: Dylan Verheul wrote: Stefan, your plugin also seems to be missing the ability to search on a part of the result that is not at the beginning of the line. Example: if I would search for continents (let's say possible results: North America, South America, Europe, Africa, Asia, Australia), and started typing am, I'd want both America's to show up. 8 snip 8 In the example you search by country name, not the continent list. So the ajax backend searches only there and only the beginning I understand how the example works. It's just that if you want to have a real world autocomplete, you should take into account real world uses. If your backend searches inside the text instead of only the beginning, and you implement caching, you'll need a javascript search to imitate the backend. You can see an example in my autocompleter. http://www.dyve.net/jquery?autocomplete ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ Sorry, my vision of an autocompleter is way different the yours. Firefox address bar searches from the beginning, Thundirbird's autocomplete starts from the beginning when you type an E-mail address, Gmail same behavior, etc. etc.. The users are used with this behavior, why should my autocompleter do things in a different way? What real world autocompleter?This is not a search box. Is a suggestion box. If you want a search box build your own backend the way you want and set autofill to false and there you have it. BTW: you pointed enough to your plugin in this thread. This is not a competition, I will not use it as code reference nor behavior. Is a good thing there are more plugins to choose from, leave it like this. Anyway I would expect a reply with a link to your plugin. Besides, I will include your plugin on my website in other plugins list page. Oh joy. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] First/Last Parent
Hi, Is there any method to access the first parent of an element who is of type X. For example elem1 name=1 elem1 name=2 elem1 name=3 elem2 /elem1 /elem1 /elem1 I have elem2 object, and want to access the first seen elem1 (whose name is 3), or last parent who is elem1 (whose name is 1 in my example). I provide name just for clarification, and there is no such attribute in my original HTML. Thanks. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] tableSorter feedback requested!
Hi All, I'm currently working on the 1.1 release of tableSorter. I would love to here your request for new features, improvements and thoughts to make this little plugin even better! Here's my current list of features and improvements that will be in 1.1: * A real user manual, with more examples and all parameters documented. * Make parameter names more logical. * Provide api documentation. * Commit the tableSorter in to the jQuery svn with manual and api. * Add function for highlighting current selected row. * Provide a excel theme using css. * Add support for row numbering. * Add filter support. * Add John's pager plugin, and provide examples. * Add support for custom icons (adding images to headers). * Add more parsers (UK long date). * Add support for HTML elements in td cells (Get values from any child element) Thanks to everyone for all the support, cheers and comments! /christian ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] tableSorter feedback requested!
Hi, The way it's currently implemented is to just check the first row in the tbody. There is however a way to specify your own parser, using column index and the parser id string. Ex. $('.aTable').tableSorter({ columnParser: [[0,'time'],[2,'shortDate']]; } This will be fully documented in the user manual. /christian Mohsen Saboorian wrote: Hi Christian, Just a question. How do you decide for a column type? I'd seen that you have some analyzers, but don't know if you analyze every cell of a row, or only the first one, or ...? On 8/30/06, Christian Bach [EMAIL PROTECTED] wrote: Hi All, I'm currently working on the 1.1 release of tableSorter. I would love to here your request for new features, improvements and thoughts to make this little plugin even better! Here's my current list of features and improvements that will be in 1.1: * A real user manual, with more examples and all parameters documented. * Make parameter names more logical. * Provide api documentation. * Commit the tableSorter in to the jQuery svn with manual and api. * Add function for highlighting current selected row. * Provide a excel theme using css. * Add support for row numbering. * Add filter support. * Add John's pager plugin, and provide examples. * Add support for custom icons (adding images to headers). * Add more parsers (UK long date). * Add support for HTML elements in td cells (Get values from any child element) Thanks to everyone for all the support, cheers and comments! /christian ___ 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] IE7 and XmlHttpRequest: check native first instead of ActiveX
Hi all, the following lines lead to IE7 using the XmlHttpRequest object as ActiveX object and not as native JavaScript object (even if it's not sooo native): // If IE is used, create a wrapper for the XMLHttpRequest object if ( jQuery.browser.msie ) XMLHttpRequest = function(){ return new ActiveXObject( navigator.userAgent.indexOf(MSIE 5) = 0 ? Microsoft.XMLHTTP : Msxml2.XMLHTTP ); }; Related: http://ajaxian.com/archives/ajax-on-ie-7-check-native-first I think it would be better to avoid ActiveX in IE7 and use object detection like the following, besides that Opera can disguise itself completely as IE (http://webstandardsgroup.org/features/david-storey.cfm, see question 9): // If IE is used, create a wrapper for the XMLHttpRequest object if ( !XMLHttpRequest ActiveXObject ) XMLHttpRequest = function(){ return new ActiveXObject( navigator.userAgent.indexOf(MSIE 5) = 0 ? Microsoft.XMLHTTP : Msxml2.XMLHTTP ); }; -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Critical: val('something') does not work in 1.0
Hi, with Version 1.0 $(...).val('something') does not work anymore. This bug was introduced in Rev 228. With the attr code from 226 it works... Ugh! -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] help w/ getIfModified
on lines 1 and 3 I put alerts - I'm confused as where the res variable in the function comes from - since res does not exist before the function in the code how can it be a variable in the function? You're giving jQuery.ajax() a callback function as the 4th arg. When that function is called it is passed the XMLHttpRequest and the status. Take a look at onreadystatechange in the source code. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] IE7 and XmlHttpRequest: check native first instead of ActiveX
// If IE is used, create a wrapper for the XMLHttpRequest object if ( !XMLHttpRequest ActiveXObject ) XMLHttpRequest = function(){ return new ActiveXObject( navigator.userAgent.indexOf(MSIE 5) = 0 ? Microsoft.XMLHTTP : Msxml2.XMLHTTP ); }; I assume that you didn't try that code, because it freaks out in IE (if memory serves me correctly - maybe it was Opera). I'll probably change it to this: if ( jQuery.browser.msie XMLHttpRequest == undefined ) Ticket for this is here: http://proj.jquery.com/dev/bugs/bug/158/ --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] css('height') does not work?!
John Resig schrieb: shouldn't css('height') return the height of an element? It doesn't work anymore (Rev 226), but height() does. Or does css('height') not exist anymore in favor of height()? Hmm - rev 226 is actually before the final 1.0 release, could you try 1.0 and see if you continue to encounter the same problem? http://jquery.com/src/jquery-1.0.js Hi John, sorry was no problem at all, Dave explained the difference between height() and css('height') to me... -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Interface library: jQuery is not defined
Hi, I was just trying to switch to the latest version of JQuery. But I have problems when including the interface library. I always get JQuery is not defined in interface.js. I have downloaded the latest from JQuery and Interface: http://proj.jquery.com/src/latest/ http://interface.eyecon.ro/download I have already seen the following bug tracker entry but it still seems to be an issue, although I have followed John's statement: http://proj.jquery.com/dev/bugs/bug/64/ The current version of Interface (which I assume that you're using) is only compatible with the latest versions of jQuery. This includes 1.0a and newer. What am I missing to do? Thanks and cheers, Arash ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] del.icio.us powered mp3 player plugin
Franck Marcia schreef: I tested it with IE5.5, IE6, IE7RC1, FF1.5.0.6 and Opera9 and it works fine... if you remove object and only keep embed: http://fmarcia.info/jquery/mp3/mp3.html Thanks this really did the trick and cut down the code a lot. I will add a more flexible optional parameter field so that the player is adjustable too and checking for the href attribute and if the file is an mp3 file. -- David Duymelinck [EMAIL PROTECTED] ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Interface library: jQuery is not defined
Ok, this one did the trick: http://jquery.com/src/jquery-1.0.pack.js I had to go over to the jquery blog, to find it. Btw: the jquery website is getting really confusing. I am never sure where the most updated information can be found. Is it jquery.com or proj.jquery.com? What is the difference between them anyway? Where do you all go to look for news, downloads, documentation, plugins, etc.? Thanks and cheers, Arash Arash Yalpani schrieb: Hi, I was just trying to switch to the latest version of JQuery. But I have problems when including the interface library. I always get JQuery is not defined in interface.js. I have downloaded the latest from JQuery and Interface: http://proj.jquery.com/src/latest/ http://interface.eyecon.ro/download ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Interface Elements for jQuery
I would like to get in touch, off-list with the author of the Interface Elements plugin for jQuery.. Can anyone send me to the right direction/person? Steef ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Interface library: jQuery is not defined
Btw: the jquery website is getting really confusing. I am never sure where the most updated information can be found. Is it jquery.com or proj.jquery.com? What is the difference between them anyway? Where do you all go to look for news, downloads, documentation, plugins, etc.? Actually, this list is good a place to start. I can only guess about the current state of the website: jquery.com, with the blog being the only exception, is months old. proj.jquery.com contains much more up-to-date information. There are several WIKI entries that make a good read and there is the quite up-to-date plugin list and the bug tracking system. For the latest version, the best bet is the source control system itself, I use Eclipse with the Suclipse plugin to check out the latest source from svn://jquery.com/jquery and build it myself with the ant script (build.xml). -- Jörn -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] tableSorter feedback requested!
I would love to here your request for new features, improvements and thoughts to make this little plugin even better! You've heard this one from me via email: * Secondary sort (ie., user clicks on one column, it primary sorts by that one, then secondary sorts by another named column). -- Morbus Iff ( HOW DO I DELIT TEH TREE [EMAIL PROTECTED] ) Technical: http://www.oreillynet.com/pub/au/779 Culture: http://www.disobey.com/ and http://www.gamegrene.com/ icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Interface library: jQuery is not defined
Hi Jörn, Jörn Zaefferer wrote: Actually, this list is good a place to start. I can only guess about the current state of the website: jquery.com, with the blog being the only exception, is months old. proj.jquery.com contains much more up-to-date information. There are several WIKI entries that make a good read and there is the quite up-to-date plugin list and the bug tracking system. you are right, the proj.jquery.com site seems to be more up-to-date. John, is there a special reason you are still hosting both versions? Cheers, Arash ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] tableSorter feedback requested!
Hi Christain,can't wait for 1.1!!re filters,i'd love to be able to define different types of filters, so some row filters can be text boxes and some can be drop down lists etc..Xlsheet has some good ideas on filters (unfortunately if IE only) http://xlsheet.sourceforge.net/Adjustable column widths (http://makoomba.altervista.org/grid/) would also be a great enhancement keep up the great workCheersJustinOn 8/30/06, Christian Bach [EMAIL PROTECTED] wrote: Hi All,I'm currently working on the 1.1 release of tableSorter.I would love to here your request for new features, improvements andthoughts to make this little plugin even better!Here's my current list of features and improvements that will be in 1.1:* A real user manual, with more examples and all parameters documented.* Make parameter names more logical.* Provide api documentation.* Commit the tableSorter in to the jQuery svn with manual and api. * Add function for highlighting current selected row.* Provide a excel theme using css.* Add support for row numbering.* Add filter support.* Add John's pager plugin, and provide examples. * Add support for custom icons (adding images to headers).* Add more parsers (UK long date).* Add support for HTML elements in td cells (Get values from any childelement)Thanks to everyone for all the support, cheers and comments! /christian___jQuery mailing listdiscuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] problem with $(TAGNAME, httprequest.responseXML) with certain browsers
Hi! I ran into the following problem trying to retrieve elements from responseXML with this function: function callback(httprequest) { var resp = httprequest.responseXML; $(body).append(pdivs found in document: +$(div).cur.length+/3/p) .append(pproperties found in responseXML +$(properties, resp).cur.length+/1/p) .append(pjsconf found in responseXML +$(jsconf, resp).cur.length+/1/p) .append(pthings found in responseXML +$(thing, resp).cur.length+/2/p); } The first append allways works as expected, but the last three (the ones that select elements from resp) behave differently depending on the browser and the content of responseXML... Case 1: elements in resp contain no namespaces (e.g. Envelope/Envelope) Works in Opera8+ and Firefox 1.5+ Does not find any elements in IE6 Case 2: elements in resp contain namespaces but have no prefixes (e.g. Envelope xmlns=http://schemas.xmlsoap.org/soap/envelope/;/Envelope) Works in Opera8+ and Firefox 1.5+. As I expected both browsers simply ignore the namespace of the elements and select all elements with the specified tagName. Does not find any elements in IE6. Case 3: elements in resp have namespaces and prefixes defined (e.g. soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/;/soap:Envelope) Firefox and Opera can't find elements with prefixes. As far as I have seen, this is caused in jQuery.filter() by this snipped of code: m[2]== '*'||a.nodeName.toUpperCase()==m[2].toUpperCase() which is defined in jQuery.g (specifically by comparing with the nodeName, which is a combination of localName and prefix). By replacing this with code that compares m[2] with either the localName (if it exists) or the nodeName I managed to get FF and Opera to behave just as in Case 2*. IE does not find any elements. Now my questions: Is there a possible way to get behaviour that FF and Opera show in case 2 (and modified case 3) from all three major browsers? If there isn't, is there another way I can extract elements by their nodeName or localName from responseXML that works the same in these browsers? thanks in advance Mario *In case someone is interested, the code I used was: m[2]== '*'||((a.localName != null) ? a.localName.toUpperCase()==m[2].toUpperCase() : a.nodeName.toUpperCase()==m[2].toUpperCase()) PS: If necessary I can supply a minimal testcase. -- EFKON AG Mario Landgraf System Development ITS Projects Am Arlandgrund 2 8045 GRAZ AUSTRIA Mail: [EMAIL PROTECTED] Web : http://www.efkon.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] tableSorter feedback requested!
I was thinking that the diffent parser would be in charge for choosing the appropriate filter type. Ex. $.tableSorter.filters.date = { // add logic and markup for filter type date } $.tableSorter.parsers.shortDate = { id: 'shortDate', // assign a filter class filter: $.tableSorter.filters.date, is: function(s) { return s.match(/^\d{1,2}[/-]\d{1,2}[/-]\d{4}$/); }, format: function(s) { s = s.replace(/-/g,'/'); var defaults = $.tableSorter.utils.getParams(); if(defaults.dateFormat == mm/dd/ || defaults.dateFormat == mm-dd-) { /** reformat the string in ISO format */ s = s.replace(/(\d{1,2})[/-](\d{1,2})[/-](\d{4})/, '$3/$1/$2'); } else if(defaults.dateFormat == dd/mm/ || defaults.dateFormat == dd-mm-) { /** reformat the string in ISO format */ s = s.replace(/(\d{1,2})[/-](\d{1,2})[/-](\d{4})/, '$3/$2/$1'); } return parseFloat((new Date(s)).getTime()); }, sorter: $.tableSorter.sorters.numeric }; /christian Justin Kelly wrote: Hi Christain, can't wait for 1.1!! re filters, i'd love to be able to define different types of filters, so some row filters can be text boxes and some can be drop down lists etc.. Xlsheet has some good ideas on filters (unfortunately if IE only) http://xlsheet.sourceforge.net/ Adjustable column widths (http://makoomba.altervista.org/grid/) would also be a great enhancement keep up the great work Cheers Justin On 8/30/06, Christian Bach [EMAIL PROTECTED] wrote: Hi All, I'm currently working on the 1.1 release of tableSorter. I would love to here your request for new features, improvements and thoughts to make this little plugin even better! Here's my current list of features and improvements that will be in 1.1: * A real user manual, with more examples and all parameters documented. * Make parameter names more logical. * Provide api documentation. * Commit the tableSorter in to the jQuery svn with manual and api. * Add function for highlighting current selected row. * Provide a excel theme using css. * Add support for row numbering. * Add filter support. * Add John's pager plugin, and provide examples. * Add support for custom icons (adding images to headers). * Add more parsers (UK long date). * Add support for HTML elements in td cells (Get values from any child element) Thanks to everyone for all the support, cheers and comments! /christian ___ 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] tableSorter feedback requested!
christian,that sounds pretty goodwould be nice if it could be: if you define a row as X type filter(the use that filter) and if its not defined use the tablesorter parser default### ie. if tr class set to 'filter_drop_down' -- then use drop down filterelse no filter explicity set so use tablesorter parser default#thanks againjustinOn 8/30/06, Christian Bach [EMAIL PROTECTED] wrote: I was thinking that the diffent parser would be in charge for choosingthe appropriate filter type.Ex.$.tableSorter.filters.date = {// add logic and markup for filter type date}$.tableSorter.parsers.shortDate = { id: 'shortDate',// assign a filter classfilter: $.tableSorter.filters.date,is: function(s) {return s.match(/^\d{1,2}[/-]\d{1,2}[/-]\d{4}$/);}, format: function(s) {s = s.replace(/-/g,'/');var defaults = $.tableSorter.utils.getParams();if(defaults.dateFormat == mm/dd/ || defaults.dateFormat ==mm-dd-) {/** reformat the string in ISO format */s = s.replace(/(\d{1,2})[/-](\d{1,2})[/-](\d{4})/, '$3/$1/$2');} else if( defaults.dateFormat == dd/mm/ || defaults.dateFormat== dd-mm-) {/** reformat the string in ISO format */s = s.replace(/(\d{1,2})[/-](\d{1,2})[/-](\d{4})/, '$3/$2/$1'); }return parseFloat((new Date(s)).getTime());},sorter: $.tableSorter.sorters.numeric};/christianJustin Kelly wrote: Hi Christain, can't wait for 1.1!! re filters, i'd love to be able to define different types of filters, so some row filters can be text boxes and some can be drop down lists etc.. Xlsheet has some good ideas on filters (unfortunately if IE only) http://xlsheet.sourceforge.net/ Adjustable column widths ( http://makoomba.altervista.org/grid/) would also be a great enhancement keep up the great work Cheers Justin On 8/30/06, Christian Bach [EMAIL PROTECTED] wrote: Hi All, I'm currently working on the 1.1 release of tableSorter. I would love to here your request for new features, improvements and thoughts to make this little plugin even better! Here's my current list of features and improvements that will be in 1.1: * A real user manual, with more examples and all parameters documented. * Make parameter names more logical. * Provide api documentation. * Commit the tableSorter in to the jQuery svn with manual and api. * Add function for highlighting current selected row. * Provide a excel theme using css. * Add support for row numbering. * Add filter support. * Add John's pager plugin, and provide examples. * Add support for custom icons (adding images to headers). * Add more parsers (UK long date). * Add support for HTML elements in td cells (Get values from any child element) Thanks to everyone for all the support, cheers and comments! /christian ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/ -- email: [EMAIL PROTECTED]Mob.: 0402 667 075jabber: [EMAIL PROTECTED] gtalk: [EMAIL PROTECTED]msn: [EMAIL PROTECTED]yahoo im: justinjameskellyicq: 202893989 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] help w/ getIfModified
This sample helps you? http://pepper.sherry.jp/jquery/newajaxfunc2.html $().load() / $().get() / $.().post() callback's 2nd argument shows status. If status == 'success', ajax request succeeded. If status == 'error', ajax request failed. (because file not found, timeout, etc.) When $().loadIfModified() / $().getIfModified called, the status of notmodified might return. When the file on the server has not been changed, notmodified is returned. This is useful to monitor the change of the file periodically. On 8/30/06, Will Jessup [EMAIL PROTECTED] wrote: Still working on the GetIfModified as outlined here: http://www.mail-archive.com/discuss@jquery.com/msg00481.html Any examples of how to use this properly? I'm not sure how to grab the states success, failure, notomdified etc. will ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- --- Handle : 沢渡 みかげ ([EMAIL PROTECTED]) ☆沢渡 みかげ☆ PGP5 DH/DSS key FP : 76D9 DBB7 5E3C 865B 7A60 A1E8 0A97 3DF0 B130 0941 You can get my PGP key at http://www.mikage.to/mikage/mikage.asc ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] jQuery / ThickBox in .net magazine (UK)
In the latest issue of .net (http://www.netmag.co.uk/), there is a section on using lightboxes to show images (page 80). (no online version, so you would have to read about it in the old fashioned way)It starts off with the original lightbox (that uses prototype and scripaculous), but then goes onto ThickBox (with its smaller download size and AJAX support). I think there have been improvements since the writing of the article though. The author (Rik Lomas, who does not have a favourite cheese) interviewed John Resig at the start of this month: http://rikrikrik.com/log/jquery-interviewMaybe Christian Bach's tableSorter, or Stefan Petre with his Interface plugins will be featured in a future edition?Have any other magazines featured jQuery (or a related plugin)? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] tableSorter feedback requested!
Or even better than that, would be secondary sort when the user holds Shift or Control.On 8/30/06, Morbus Iff [EMAIL PROTECTED] wrote: I would love to here your request for new features, improvements and thoughts to make this little plugin even better!You've heard this one from me via email:* Secondary sort (ie., user clicks on one column, it primarysorts by that one, then secondary sorts by another named column). --Morbus Iff ( HOW DO I DELIT TEH TREE [EMAIL PROTECTED] )Technical: http://www.oreillynet.com/pub/au/779Culture: http://www.disobey.com/ and http://www.gamegrene.com/icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus___ jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Simple form setup
I am very, very new at JQuery and only mildly competent with javascript, so please be patient. I have a form that at present validates by js first and then the js submits the form. Of course, the form doesn't work at all if js is disabled. I want to change it so that the buttons are setup as submit buttons, but updated by jquery to ordinary buttons with onclick events. I'm struggling at bit with the syntax. Here is my code so far: html head script type=text/javascript src=jquery.js/script script type=text/javascript $(document).onready( $(document.getElementsById(sendmail)) .set(onclick, validate()).set(type, button) ); function validate() { alert ('validated'); } /script /head body form input type=submit name=sendmail id=sendmail value=SEND class=button / /form /body /html -- View this message in context: http://www.nabble.com/Simple-form-setup-tf2187171.html#a6050642 Sent from the JQuery forum at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Vitamin newsletter signup in jQuery?
Thats great thank you. I'll try and learn something from that and create something from the site! David-260 wrote: A way to go is giving the form and all inputs an id and use the ajax function $.post example : form id=form action=test.php input type=text name=text id=textbr input type=submit value=send id=send /form the javascript code would be $(send).click(function(){ $.post(test.php, {test: $(text).val()}, function(xml){ $(form).html('Email send'); } ); return false; }); Or you could go the php way and change a variable when the form is posted and wrap an if else around the form. ?php if(count($_POST) 0) { $var = 1; } if($var == 1){ ? Email send ?php }else{ ? form id=form action=test.php input type=text name=text id=textbr input type=submit value=send id=send /form ?php } ? This is quick code so don't put it on you site like it is. Hambo Design (Steven) schreef: Is it possible to recreate the newsletter signup at www.thinkvitamin.com http://www.thinkvitamin.com/ using jQuery? I am not very proficient with jQuery (only just used the scroll feature today!). At the moment I have a php form which just squirts an h3 at the beginning if the send is successful but I’d love to just instantly hide the form and replace it with a ‘Your email has been sent’ message. Thanks in advance, Steven Hambleton -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.11.6/430 - Release Date: 28/08/2006 ___ 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/Vitamin-newsletter-signup-in-jQuery--tf2185621.html#a6049825 Sent from the JQuery forum at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] problem with $(TAGNAME, httprequest.responseXML) with certain browsers
Hi Mario - It appears as if you're using an old version of jQuery, could you try it with jQuery 1.0? http://jquery.com/src/jquery-1.0.js The syntax that you used was deprecated, doing: $(properties, resp).cur.length You can now do: $(properteis, resp).size() or: $(properties, resp).length To get what you need - if you could try it with the new version and see if the problem still occurs, I'd really appreciate it. --John On 8/30/06, Mario Landgraf [EMAIL PROTECTED] wrote: Hi! I ran into the following problem trying to retrieve elements from responseXML with this function: function callback(httprequest) { var resp = httprequest.responseXML; $(body).append(pdivs found in document: +$(div).cur.length+/3/p) .append(pproperties found in responseXML +$(properties, resp).cur.length+/1/p) .append(pjsconf found in responseXML +$(jsconf, resp).cur.length+/1/p) .append(pthings found in responseXML +$(thing, resp).cur.length+/2/p); } The first append allways works as expected, but the last three (the ones that select elements from resp) behave differently depending on the browser and the content of responseXML... Case 1: elements in resp contain no namespaces (e.g. Envelope/Envelope) Works in Opera8+ and Firefox 1.5+ Does not find any elements in IE6 Case 2: elements in resp contain namespaces but have no prefixes (e.g. Envelope xmlns=http://schemas.xmlsoap.org/soap/envelope/;/Envelope) Works in Opera8+ and Firefox 1.5+. As I expected both browsers simply ignore the namespace of the elements and select all elements with the specified tagName. Does not find any elements in IE6. Case 3: elements in resp have namespaces and prefixes defined (e.g. soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/;/soap:Envelope) Firefox and Opera can't find elements with prefixes. As far as I have seen, this is caused in jQuery.filter() by this snipped of code: m[2]== '*'||a.nodeName.toUpperCase()==m[2].toUpperCase() which is defined in jQuery.g (specifically by comparing with the nodeName, which is a combination of localName and prefix). By replacing this with code that compares m[2] with either the localName (if it exists) or the nodeName I managed to get FF and Opera to behave just as in Case 2*. IE does not find any elements. Now my questions: Is there a possible way to get behaviour that FF and Opera show in case 2 (and modified case 3) from all three major browsers? If there isn't, is there another way I can extract elements by their nodeName or localName from responseXML that works the same in these browsers? thanks in advance Mario *In case someone is interested, the code I used was: m[2]== '*'||((a.localName != null) ? a.localName.toUpperCase()==m[2].toUpperCase() : a.nodeName.toUpperCase()==m[2].toUpperCase()) PS: If necessary I can supply a minimal testcase. -- EFKON AG Mario Landgraf System Development ITS Projects Am Arlandgrund 2 8045 GRAZ AUSTRIA Mail: [EMAIL PROTECTED] Web : http://www.efkon.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- John Resig http://ejohn.org/ [EMAIL PROTECTED] ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Interface library: jQuery is not defined
you are right, the proj.jquery.com site seems to be more up-to-date. John, is there a special reason you are still hosting both versions? I'm working on moving proj.jquery over to jquery.com - unfortunately it's pretty tricky, and I just want to make sure that we don't lose anything in the process. --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Simple form setup
On Aug 29, 2006, at 8:54 PM, Mungbeans wrote: Here is my code so far: html head script type=text/javascript src=jquery.js/script script type=text/javascript $(document).onready( $(document.getElementsById(sendmail)) .set(onclick, validate()).set(type, button) ); function validate() { alert ('validated'); } /script /head body form input type=submit name=sendmail id=sendmail value=SEND class=button / /form Hi Mungbeans, :) First thing to change is your first line. You can wrap your onclick events in the jQuery $(document).ready() instead. Then, you can refer to DOM elements the way you would in CSS. So instead of $(document.getElementsById(sendmail)) you can have something like this: $(#sendmail). (Oh, and by the way, it should have been getElementById, singular). I'm not sure about the rest of what you're trying to do, but you'll probably want to add an action attribute to the form element as a fall back in case js is disabled and use PHP or some other server- side language to take care of things. Now, back to making the alert work with jQuery, here is what the code might look like: $(document).ready(function() { $(#sendmail).click( function() { validate(); }); }); function validate() { alert('validated'); } Of course, if you don't want to stop the default event on click, you'll have to put return false; after validate(); (both without quotation marks). Let me know if that works for you. ___ Karl Swedberg www.englishrules.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] First/Last Parent
Thank you John, that helps (but a little slower than my own impl). I'd imagine so. It's virtually impossible to get the elements that you desire without taking more code to write it. Considering that the optimal implementation can make so many shortcuts: function getFirst(type) { var cur = this.parentNode; while ( cur != document.documentElement ) { if ( cur.nodeName == type ) return cur; cur = cur.parentNode; } } The phrase a little bit slower is probably a safe way to describe any JavaScript library or framework, since they all have to make concessions to some degree. --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Simple form setup
On Aug 30, 2006, at 12:58 PM, Karl Swedberg wrote: Of course, if you don't want to stop the default event on click, you'll have to put return false; after validate(); (both without quotation marks). Oops! I meant if you /want/ to stop the default action... ___ Karl Swedberg www.englishrules.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Recommended version
Here's a little tidbit from The JavaScirpt Anthology that might help:Measuring Visible Tooltip Dimensions:In order for the dimensions of the tooltip to be measured it first must be appended to the document. This will automatically make it appear on the page, so to prevent the user seeing it display in the wrong position, we need to hide it. We do so by setting is visibility to hidden until we have finalized the tooltip's position. We can't use the more familiar display property here, because objects with display set to none are not rendered at all, so they have no dimensions to measure. On 8/30/06, Klaus Hartl [EMAIL PROTECTED] wrote: John Resig schrieb: position: absolute becomes position: static, prependTo(body)[0] becomes prependTo(e.parentNode)[0] However, the problem continues to be that you can't do that without severe implications. Since you're adding an additional element into the parent, it will push the rest of the contents down - and that will definitely cause a flash of content moving around. If we can ever, reliably, figure out how to get the accurate height/width of an element that has display: none, that'll sure be nice.I see. The problem is, that if you set something to position: absolute,it shrinks to fit. Maybe this is also the reason why the height is miscalculated.Another point is that if I append some element to the body, it mayinherit other styles than where it originally was. Apart from that, inmy case the element in question is a dd element. Appending that to the body results in invalid html, and than results may be unpredictable anyway.And I couldn't see that flash of content although, but maybe my computeris too fast.Maybe you could wrap another element around it with overflow: hidden and height: 0, not sure if that works...-- Klaus___jQuery mailing listdiscuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] AJAX .Load stripping out a STYLE tag.
Hello everyone. Ive been a loner for a little bit but its time to actually ask a question.. :) Im using the $().load function to populate a DIV with the result of a server-side XSLT. The top of the XSLT contains a style tag which jQuery seems to ignore. Is there a way around this? Thanks, Matthew Hartman Programmer/Analyst Information Management, ICP Kingston General Hospital (613) 549- x4294 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] version variable?
On 8/29/06, Kenzie Campbell [EMAIL PROTECTED] wrote: Is there a jquery variable for the currently loaded version of jquery?You can use:$().jquery-wil ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Recommended version
We can't use the more familiar display property here, because objects with display set to none are not rendered at all, so they have no dimensions to measure. This is precisely what jQuery does already. It adds the element to the body, with a visibility of hidden - just to get a semi-correct width/height reading. It's very frustrating. --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] using end() repeatedly
I have something like: return this.filter('[EMAIL PROTECTED]').not('input').not('textarea').not('select').each(function (){ /* stuff */ }).end('select').end('textarea').end('input').end('[EMAIL PROTECTED]');1. Is this query completely daft? AFAIK, I can't use commas like: not('input, textarea, select') 2. I'm passing arguments to the ends because it's easier to keep track of them. Kind of like closing parenthesis and tabbing.3. Is this the way it was intended or am I missing something? It's possible to just return directly from the stack, but it doesn't seem as maintainable or clear. Still, I'm not completely happy with the syntax. Thoughts?-brito ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] version variable?
You can use: $().jquery Currently that only contains the SVN revision number - which is hardly ideal. To make sure that your plugin is using jQuery 1.0, for example, you can do: // Rev 231 is jQuery 1.0 if ( parseInt( jQuery.fn.jquery ) = 231 ) { // Do your 1.0 code here } I do want to add in a solid revision number soon, so that you can just say: if ( jQuery.version = 1.0 ) { ... } --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] AJAX .Load stripping out a STYLE tag.
I'm using the $().load function to populate a DIV with the result of a server-side XSLT. The top of the XSLT contains a style tag which jQuery seems to ignore. Is there a way around this? It's not so much an issue of jQuery ignoring the style element - it's an issue of browsers ignoring it. If memory serves me correctly, using style elements and innerHTML is particularly dicey. Do you think you could provide a quick example of what you're doing, so that we can check it out some more? --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] redraw problems when replacing table rows
See this test page: http://dev.corefive.net/jquery/tablerows.lasso Each 'delete' link should hide the current table row. The 'do it' link refreshes all rows with random data. I see various redraw/spacing issues in all browsers when clicking different combinations of the available links. I can avoid most of them by replacing the .hide('slow') with .css({display:'none'}), but it certainly isn't as cool. :/ The worst issue, however, seems to only happen in Opera. When the rows are replaced, they all run together inline instead of remaining in a grid. Any thoughts on how to work around these issues? Thanks! Jason -- View this message in context: http://www.nabble.com/redraw-problems-when-replacing-table-rows-tf2193179.html#a6069404 Sent from the JQuery forum at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Thickbox and iFrame query strings
Yehuda Katz wrote: For some reason, Thickbox made the design decision to strip the entire query string (not just the thickbox parameters) from the URL loaded into the i-frame. This caused me problems, because I actually did need to pass parameters to a dynamic page. What's the benefit of stripping all parameters (I just left in the Thickbox params, and all is well). You'll have to talk to Cody for the original reasoning. All I can come up with is that maybe passing unwanted values to scripts could cause problems? Someone posted a hack in the Thickbox forum: http://codylindley.com/thickboxforum/comments.php?DiscussionID=11page=1 That worked for him, though not some others, including myself. I made it work in my specific case with the following hack: //urlNoQuery = url.substr(0,TB_strpos(url, ?)); urlNoQuery = url; (Search for the commented line; it's the original. There are two instances right after each other. The new line doesn't make any special sense. It's just a workaround.) Cody's working on a new version for release soon(no more specific), which will allow for passing variables: http://codylindley.com/thickboxforum/comments.php?DiscussionID=97page=1#Item_5 Make feature requests here: http://codylindley.com/thickboxforum/comments.php?DiscussionID=90page=1#Item_12 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/