Re: [jQuery] jEditable: how to remove behaviour
On 28/03/07, Abel Tamayo [EMAIL PROTECTED] wrote: Hi all, I'm using jEditable for a webpage, but I would like to make it so that, once you've edited the text, the behaviour is removed and you can edit it no longer. Does anyone know how to do that? Thanks. You could try $(#myjeditable).unbind(click) Although perhaps it would be better if the plugin could do that (I don't know if there are any memory leaks that may be caused by doing it this way). ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] JQuery vs prototype
On 28/03/07, Jörn Zaefferer [EMAIL PROTECTED] wrote: Michel Brouckaert schrieb: If you have more time and the project would be a really big one, i would advice you to rather use Prototype. Class based designs mostly only pay off in huge projects because of reusability. So at the end of the line I think it depends... I think reusing jQuery code by putting it in the form of plugins works great in big projects too. After all, a big project can only work if its carefully assembled of small parts. And those small parts can be jQuery plugins. Of course there are aspects, mostly domain-specific, that are not well represented as plugins. But I wouldn't implement those in JavaScript anyway. -- Jörn Zaefferer http://bassistance.de I think JavaScript is mostly use as a way to enhance the user experience and reduce the load on the web server. Pages should not rely on it to work. Although, to be honest, I have done a few pages that need it, but the users are guaranteed to have it enabled (as their either aren't many of them, or the application is used internally). If you are providing information for a wide audience (e.g. health related) then it certainly should not be a requirement as I can imagine there would be issues with accessibility (for those using alternative browsing methods or with JavaScript turned off). When I was initially looking at frameworks, Prototype was one of my first choices, but the lack of documentation put me off. I'm also not keen of the obtrusiveness that it encourages. Others (can't recall which ones) did not look easy to use and / or a bit heavy weight (I don't think Mootools even existed). I wonder what would have happened if jQuery was not created? Prototype may never have been documented and JavaScript libraries in general would not have been as good (competition helps to motivate people). ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] change event on select
On 26/03/07, Kush Murod [EMAIL PROTECTED] wrote: So is this a bug or feature limitation? Perhaps it doesn't work because DIV's don't have an 'onchange' event? Also, IE does use event bubbling: http://www.quirksmode.org/js/events_order.html (it was IE that first used it) Kush Murod wrote: Hi Mike, 1. Binding event after content loads works that perfectly. 2. However using bubbling works only in FF not in IE, that's too bad, 'cause I find bubbling more elegant and clean. I'll just use method 1 for now. Thanks heaps --Kush Mike Alsup wrote: Kush, You just need to bind the change event to the select element after it's been inserted into the DOM. Mike On 3/26/07, Kush Murod [EMAIL PROTECTED] wrote: Hi Sam, Still didn't work, my guess is The reason I guess, because that 'select' is loaded through AJAX, and once loaded event is not triggered, so I gotta use bubbling --Kush Sam Collett wrote: On 26/03/07, Kush Murod [EMAIL PROTECTED] wrote: anyone? Kush Murod wrote: Hi, I am trying to do event bubbling on selectbox, works in FF not in IE Maybe I am missing something? $(#workList).change(function(event){ var me = $(event.target); alert(me.attr('name')); }); div class=list id=workList ... select name=perpage style=width:45px; option value=50 label=5050/option option value=60 label=6060/option /select ... /div Any reason why you can't just do: $(#workList select).change(function(){ alert(Selected: + this.value); }); No bubbling required. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery Powered Sites - Keep the Links Coming
On 28/03/07, Jason Levine [EMAIL PROTECTED] wrote: Don't know if I'm the first to realize this or if I'm just slow, but I just realized that Mozilla.org uses JQuery. I was looking at some image previews of an extension and the images popped up in a thickbox style. I got curious as to what they were using so I looked at the source. Turns out that they use JQuery (v 1.1.1) and Thickbox (v 2.1)! -- John Resig does work for them though, so it is not too much of a surprise. Don't know if he was a factor in them using it, or they were going to anyway. The Mozilla site in general does look a lot better than it did in the past - may not have happened if Firefox never came out and they needed a more professional look. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Is the JQuery slowest?
On 22/03/07, codar [EMAIL PROTECTED] wrote: Please check this: http://homepages.nildram.co.uk/%7E9jack9/base2/speedtest/ Blocked here because Nildram is a hosting site (even our own hosting companies home page is blocked). Any alternative places to see this? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] change event on select
On 26/03/07, Kush Murod [EMAIL PROTECTED] wrote: anyone? Kush Murod wrote: Hi, I am trying to do event bubbling on selectbox, works in FF not in IE Maybe I am missing something? $(#workList).change(function(event){ var me = $(event.target); alert(me.attr('name')); }); div class=list id=workList ... select name=perpage style=width:45px; option value=50 label=5050/option option value=60 label=6060/option /select ... /div Any reason why you can't just do: $(#workList select).change(function(){ alert(Selected: + this.value); }); No bubbling required. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Ok... one last effort to make this work... help!
On 15/03/07, Rick Faircloth [EMAIL PROTECTED] wrote: Well, Daemach...seems I've got things working well with my jQuery client side data-handling and CF server side validation. My next step is to submit the form data and process it via CF and return the result. I've got the jQ code and CF for that for the most part. Here's my jQ Mortgage Calculation code: function CalculateMortgage(){ var Params = {}; $(input:text).each(function(){ Params[$(this).attr(name)] = $(this).val(); }); $.post(Mortgage_Calculation.cfm, Params, function(data){ $(#Result).empty().append(data); } ); } This should still work fine, but I need to know how I can notify CF that it's time to process all the data, not validate it. What can I use for that? Typically, I would put together some CF code that said If form.principal is defined, then validate the code. If there are no errors, then process the code and calculate the result. However in this case, the form.principal is being sent everytime there's on onblur event, so that won't work. I can't rely on a submit button value for triggering the calculation, since if someone hits the enter key instead of click the submit button, the submit button value won't be present. I may be over-complicating this...got any clues? Thanks, Rick You could intercept it when enter is pressed: $(input:text).bind(keypress,function(e) { var key = e.keyCode || e.charCode; if(key == 13) { CalculateMortgage(); } } ) ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Select in frames
On 16/03/07, George Moschovitis [EMAIL PROTECTED] wrote: Dear devs, I have a short question. Is there a jquery shortcut for the following js code: document.getElementById('myframe').contentWindow.document.getElementById('myframe').submit(); I am trying to programmatically submit a form in an iframe. thanks in advance, George. -- http://blog.gmosx.com http://cull.gr http://www.joy.gr http://nitroproject.org Perhaps this may help: http://webdevel.blogspot.com/2007/03/iframes-and-jquery-working-with.html Although I think jQuery should be able to do this transparently. Also I found I had to wait until the iframe had loaded before I could work with it. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Ok... one last effort to make this work... help!
On 16/03/07, Rick Faircloth [EMAIL PROTECTED] wrote: Hi, Sam, and thanks for the reply and code... I tried using your code, but still nothing happens when I try to calculate the payment. It may be my implementation of the js or it still may be a problem in my ColdFusion code. Do I just stick your code in with my CalculateMortgage function as is, or does it need anything else added... or a different position in the code? Here's where it lies now: Thanks! Rick Probably best done within document.ready as otherwise you could get an endless loop. This doesn't fix any issues you may have with CalculateMortgage, it just calls CalculateMortgage whenever you press enter when in a text field. If you have Firefox and use Firebug, you could try adding console.log(Param) just before $.post and console.log(data) just before $(#Result) to see if there are any errors. script type=text/javascript // Define CalculateMortgage in the global scope so that it is always accessible function CalculateMortgage(){ var Params = {}; $(input:text).each(function(){ Params[$(this).attr(name)] = $(this).val(); }); $.post(callpage_Validate_Mortgage_Inputs.cfm, Params, function(data){ $(#Result).empty().append(data); } ); } $(input:text).bind(keypress,function(e) { var key = e.keyCode || e.charCode; if(key == 13) {CalculateMortgage(); } } ) $(document).ready(function(){ $(#Principal).blur(function(){ $.post(callpage_Validate_Mortgage_Inputs.cfm, {principal:$(#Principal).val()}, function (data) {$(#Result_Principal).empty().append(data) } ) }); $(#Interest).blur(function(){ $.post(callpage_Validate_Mortgage_Inputs.cfm, {interest:$(#Interest).val()}, function (data) {$(#Result_Interest).empty().append(data) }) }); $(#Years).blur(function(){ $.post(callpage_Validate_Mortgage_Inputs.cfm,{years:$(#Years).val()}, function (data) {$(#Result_Years).empty().append(data) }) }); }); /script ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] OT: Detecting memory leaks in Firefox
Anyone know of any good tools for debugging memory leaks in Firefox? I have installed the Leak Monitor extension, but it does not seem to work. Plus when it did (Firefox 1.5), the constant popups proved irritating. I want to find out what is causing leaks (both in the browser and web pages), rather than that they are occurring. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] *New jQuery plugin* - autoSave
On 15/03/07, Daemach [EMAIL PROTECTED] wrote: To try and master jQuery I've been playing with a few ideas. I decided to flesh this one out for use on one of my sites and in hopes it can benefit someone else as well I'm making it available. Depending on your view of network traffic this may have limited potential for you, but it's free so no complaining ;) autoSave will automatically submit individual fields in a form as you make changes, preventing users from losing form data should the power fail, or they get called away to watch the last 3 tivo'd episodes of 24 as their browser session expires. Its most useful potential is for quick editing database records but you can use it for just about anything. You call it using $(yourFormInputs).autoSave( Function, Map ); and that's pretty much it. You just need to write the backend handler to deal with the field data as it hits the server. I'll post some tricks I use with Cold Fusion on the blog I set up later. A basic example using pure jQuery: $(document).ready(function(){ $(:input).autoSave(function(){ var ele = new Object(); // remember that this function runs in the scope of the element itself. ele[this.name] = (this.type ==checkbox) ? this.value + | + this.checked : this.value; $.post(test.cfm, ele, function (data) {$(#ResultDiv).empty().append(data);} ) }); }); You can read more about it here: http://daemach.blogspot.com/2007/03/autosave-jquery-plugin.html -- Looks good and hopefully may have some improvements in the future. OT: (to Daemach) By the way, did you get my email (I sent one a while ago and you may not have got it, and I'm not sure if you got my latest one). ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Test
On 15/03/07, Rey Bango [EMAIL PROTECTED] wrote: Test ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ $(subject:Test).reply(Another test?); ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] JQuery Form plugin
On 15/03/07, George Moschovitis [EMAIL PROTECTED] wrote: The form plugin does not currently support file uploads. Is this something easy to fix? Any workaround? -g. -- http://blog.gmosx.com http://cull.gr http://www.joy.gr http://nitroproject.org You may be able to use this plugin: http://www.pixeline.be/experiments/jqUploader/ AJAX can't be used to upload files. Systems that look like they do use an iframe (e.g. Gmail) or an object on the page (Flash, ActiveX control, Java etc). But I have never tried to myself. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to convert class to style='attrs ...'
On 15/03/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I'm trying to write a function to generate MySpace friendly HTML. MySpace does not accept link tags, so the HTML from my page that contains class='whatever', will mean nothing on the mySpace page. My question is, given an element with a class, e.g. td class='myClass'Hello/td, how would I use jQuery to rewrite that element as td style='font-family:verdana;font-size:12px;...Hello/td? Notice I have replaced the class attribute with a style attribute with all the attributes listed out. Thanks, - Dave Can't you use style? style type=text/css @import http://example.com/style.css;; /style ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] finding y position
On 14/03/07, Fabien Meghazi [EMAIL PROTECTED] wrote: By far the easiest way to do that is to use the Dimensions plugin. It is amazingly accurate, even taking into account borders, padding, overflow:scroll, etc. Any idea why the dimension plugin does not get into the jquery core ? There are more and more plugins relying on this one and it seems to be that getting positions of elements should be in core. It would add quite a lot to the file size. Also, while there are a few plugins that rely on it, the majority don't (as you can do a lot more with jQuery than positioning). I do think that Interface should use it though, as it has its own implementation of getting positioning of elements. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Scope a variable to a plugin
On 14/03/07, Tom Holder [EMAIL PROTECTED] wrote: Bit of a simple question this I'm sure but how do I scope a variable to a plugin I'm creating and not expose it beyond my plugin? I do want the variable to be accessible to all the methods in my plugin though. Thanks Tom You could write your plugin like this: (function($) { var myvar = Element number: ; $.fn.myplugin = function() { return this.each( function(i) { alert(myvar + i); }); } })(jQuery); alert(myvar); // undefined ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Scope a variable to a plugin
On 14/03/07, Tom Holder [EMAIL PROTECTED] wrote: Cheers Sam, That doesn't make a lot of sense to my I have to be honest. 1. Why are you starting with (function($) This means that it would execute immediately and any variables contained within the function won't be seen by other scripts. 2. Why $.fn inside this block? why not jQuery.fn Results in a saving of code. It is whatever you used in 1. 3. What's (jQuery) on the end of the function? jQuery is the jQuery object and is passed on as the parameter (the $ at the start). A (hopefully) simpler example: (function(parameter1, parameter2) { var space = ; alert(parameter1 + space + parameter2); // alerts 'hello world' })(hello, world); alert(space); // space is not defined It is one of the suggestions for authoring plugins: http://docs.jquery.com/Plugins/Authoring#Custom_Alias_in_plugin_code Sorry... OO Javascript is a whole new world of Pain for me! :) Thanks Tom On 14/03/07, Sam Collett [EMAIL PROTECTED] wrote: On 14/03/07, Tom Holder [EMAIL PROTECTED] wrote: Bit of a simple question this I'm sure but how do I scope a variable to a plugin I'm creating and not expose it beyond my plugin? I do want the variable to be accessible to all the methods in my plugin though. Thanks Tom You could write your plugin like this: (function($) { var myvar = Element number: ; $.fn.myplugin = function() { return this.each( function(i) { alert(myvar + i); }); } })(jQuery); alert(myvar); // undefined ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Tom Holder Technical Director SimpleWeb Limited Great websites. Low cost. No catch. http://www.simpleweb-online.co.uk/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Scope a variable to a plugin
On 14/03/07, Tom Holder [EMAIL PROTECTED] wrote: Thanks for that Sam. One further thing you might be able to help with. I have a function that loops through some elements and then inside attaches a click even that results in the HTML being reloaded... hence I need to call the function from within itself. My code looks like (I've put a note in where the call should be): Thanks! Tom jQuery.fn.plotPins = function(gMap, gMarkerMan) { //Reference to this jquery function. var jElems = this; return this.each(function(){ var listingID = jQuery(this).attr(id).replace(/pinned_/,); var lat = jQuery(abbr.lat, this).attr(title); var lng = jQuery( abbr.lng, this).attr(title); //Create the marker var gPoint = new GLatLng(lat, lng); var gMarker = new GMarker(gPoint, {icon: this._gIcon, draggable: true, bouncy: true}); gMarkerMan.addMarker(gMarker, 1); //pinnedListings[listingID] = gMarker; //Attach the pull pin event. jQuery(ul.pinned_action li.pinned_remove a,this).click(function(){ //Take the pin off the map. gMap.removeOverlay(gMarker); $(#pinned).load(ajax/GetPinned.ashx, {pull: listingID}, function(){ //I want to call the current function from itself here... my attempt that doesn't work is: //jQuery(jElems).plotPins(gMap, gMarkerMan); }); //Do ajax here to pull the pin. return false; }); //Add the marker to the marker manager //this._ }); }; Have you tried 'this' instead of 'jElems'?: jQuery(this).plotPins(gMap, gMarkerMan); I've done it that way for some of my plugins, although admittedly not within an AJAX request. On 14/03/07, Sam Collett [EMAIL PROTECTED] wrote: On 14/03/07, Tom Holder [EMAIL PROTECTED] wrote: Cheers Sam, That doesn't make a lot of sense to my I have to be honest. 1. Why are you starting with (function($) This means that it would execute immediately and any variables contained within the function won't be seen by other scripts. 2. Why $.fn inside this block? why not jQuery.fn Results in a saving of code. It is whatever you used in 1. 3. What's (jQuery) on the end of the function? jQuery is the jQuery object and is passed on as the parameter (the $ at the start). A (hopefully) simpler example: (function(parameter1, parameter2) { var space = ; alert(parameter1 + space + parameter2); // alerts 'hello world' })(hello, world); alert(space); // space is not defined It is one of the suggestions for authoring plugins: http://docs.jquery.com/Plugins/Authoring#Custom_Alias_in_plugin_code Sorry... OO Javascript is a whole new world of Pain for me! :) Thanks Tom On 14/03/07, Sam Collett [EMAIL PROTECTED] wrote: On 14/03/07, Tom Holder [EMAIL PROTECTED] wrote: Bit of a simple question this I'm sure but how do I scope a variable to a plugin I'm creating and not expose it beyond my plugin? I do want the variable to be accessible to all the methods in my plugin though. Thanks Tom You could write your plugin like this: (function($) { var myvar = Element number: ; $.fn.myplugin = function() { return this.each( function(i) { alert(myvar + i); }); } })(jQuery); alert(myvar); // undefined ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Tom Holder Technical Director SimpleWeb Limited Great websites. Low cost. No catch. http://www.simpleweb-online.co.uk/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Tom Holder Technical Director SimpleWeb Limited Great websites. Low cost. No catch. http://www.simpleweb-online.co.uk/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Selecting only one level in DOM and no deeper
On 14/03/07, Dan Eastwell [EMAIL PROTECTED] wrote: Haha! Thank you everyone, it was so simple! I should have known, too, as I know a lot more about CSS than I do about Javascript (which isn't that much!) For the record: Do the internet explorers support the child selector (when it's used in CSS and not in jQuery, of course!) Only IE7. Hence why it was used in hacks to hide stuff from IE (or to override CSS needed by IE). On 3/14/07, Karl Swedberg [EMAIL PROTECTED] wrote: The says only the first instance of that object. Hey Andy, I think I know what you meant there, but the wording might be a little misleading. The will get *all* instances of the li element that are children of the preceding ul element. It just won't get any li elements that are grandchildren (or great-grandchildren, etc.) of the ul. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Mar 14, 2007, at 11:10 AM, Andy Matthews wrote: Use the descendant selector. Div ul li Vs Div ul li The says only the first instance of that object. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dan Eastwell Sent: Wednesday, March 14, 2007 10:01 AM To: jQuery Discussion. Subject: [jQuery] Selecting only one level in DOM and no deeper I have a function function closeSubModules(subModules){ for(var i=0; i subModules.length; i++){ theElement = subModules[i]; $(theElement).hide(); } } one of the subModules[i] I've passed this function in an array is #faq li ul and hides all the sub-modules e.g. div id=faq ul li ul !-- hide this -- /ul /li /ul I've another function that toggles the hidden submodules onclick of another element on the page. If the submodule has a list inside it (e.g. as bullet points within some text) these get hidden by closeSubModules() but don't get shown by the toggle function (that only targets the #faq li ul level and no deeper). I've added this to my toggle function, $(theItems).children(ul).show(); but that is a bit of a hack and only goes one level deep, and won't show nested lists within any text in the module. Any thoughts? Thanks, Dan. -- Daniel Eastwell Portfolio and articles: http://www.thoughtballoon.co.uk Blog: http://www.thoughtballoon.co.uk/blog ___ 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/ -- Daniel Eastwell Portfolio and articles: http://www.thoughtballoon.co.uk Blog: http://www.thoughtballoon.co.uk/blog ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Do I really need to do an 'eval' in JQuery?
On 14/03/07, Graham Churchley [EMAIL PROTECTED] wrote: I want to hide the all table rows that have a specific value for the custom 'grp' attibute. This code works: $('table.grouped tr.group').click(function() { var attrName = $(this).attr(grp); eval($(this).siblings('[EMAIL PROTECTED] + attrName + ]').toggle()); return false; }) Basically, I get the 'grp' property value of the row that is clicked. Then I toggle all siblings that have the same value for the grp attribute. Question: Is there a way to do this without using the eval method? More information: I have an html table and I'm grouping the rows based on a column sort. The result is a bunch of tr elements with the same 'grp' attribute value followed by another bunch of tr elements with the same 'grp' attribute value thus: tr grp=myAttr1... tr grp=myAttr1... tr grp=myAttr1... tr grp=myAttr2... tr grp=myAttr2... tr grp=myAttr2... etc. Thanks! This should work: $('table.grouped tr.group').click(function() { var attrName = $(this).attr(grp); $(this).siblings([EMAIL PROTECTED] + attrName + ]).toggle(); }) return false is only needed if you are clicking on an a ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] JQuery and DOM functions
On 13/03/07, Guillaume Léonard [EMAIL PROTECTED] wrote: Greetings, before explaining my problem, I must advise you that I'm a beginner in Javascript, DOM and everything around it. I currently continue a web app that uses DOM so I'm learning at the same time. My problem is that I got incompatibility problem with JQuery and DOM. Let me explain a bit more... I use the ThickBox function into my webapp to display pop-ups. The ThickBox, uses JQuery librairy. When I import the JQuery Librairy into the project, and the DOM librairy has to be imported aswell (otherwise the project won't work), many DOM functions won't work. Best exemple, sometimes I call DOM.Show(..,..) in order to display a control. When I include the JQuery librairy into the project, DOM.Show still exists of course, but the objects aren't DOM anymore, they are JQuery types. Our DOM.Show function looks like that : show : function(id, style) { var o = $(id); if(!o) return; o.style.display = style || } The ID is the id's element of the form. When I don't implement JQuery.js into the project, everything works fine. If I do implement JQuery (also with DOM), the style property of the o object doesn't exist. It seems to have become a JQuery object somehow and I don't have access to DOM properties. Since the DOM.js file is a common file among many teams, I cannot change it. Overall, my question is, how can I still access the DOM properties and functions while implementing JQuery librairy ? I might not be very clear, and I'm deeply sorry for that. I hope you see my point. Thank you, Guillaume L. There is a page on the Wiki that shows how to do this (use jQuery.noConflict()): http://docs.jquery.com/Using_jQuery_with_Other_Libraries Basically, you do this: script type=text/javascript jQuery.noConflict(); (function($) { // jquery code here: $(document).ready(function(){ $(div).hide(); }); })(jQuery) /script ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Has anybody run into this?
On 12/03/07, Jörn Zaefferer [EMAIL PROTECTED] wrote: Rick Faircloth schrieb: Hi, all.. I've been working on Jorn's Validation plug-in and have just about got everything working perfectly for one particular form and I asked my wife to fill out the form and test the validation. She's got Google toolbar on her computer. When the validation kicked in, instead of my messages showing above the form fields, Google's line of something like Google toolbar can automatically fill in these fields for you So now in that case Google's info was overriding my validation responses. Has anyone had to deal with that? That's a big deal because everyone who has Google toolbar installed on their browser could have my validation overridden and not even be able to see problem entries or be able to submit a form. I guess one possible solution would be to use field names that they're not using like Full_Name instead of Name... this is only happening on the personal info, which Google toolbar can fill in. This was reported before, but I have so absolutely no clue how to prevent that. Taking non-obvious field names seems like a valid workaround. -- Jörn Zaefferer http://bassistance.de Perhaps using the plugin after the page has loaded (rather than when it is ready) would be a workaround? i.e. instead of $(document).ready, use $(window).load This link may help as well: http://code.jenseng.com/google/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Validation help with Date Selector
On 11/03/07, Jörn Zaefferer [EMAIL PROTECTED] wrote: Rick Faircloth schrieb: onInvalid: function(form) { $(form).find([EMAIL PROTECTED]).attr(disabled, disabled); }, onValid: function(form) { $(form).find([EMAIL PROTECTED]).attr(disabled, ); } That looks good to me! Hopefully that will work. I'm using Jorn's plug-in in debug mode, which is supposed to prevent submission whether the form fields are correct or not. However, since I'm using other script which works in an Ajax manner to submit the entries to another page, I think that's interfering somewhat with Jorn's plug-in and its control over the process. I'll tinker around with your methods above and see what happens. Hopefully, Jorn will show up and provide us some assistance, too... See the other thread. Just write your own submitHandler, that way you don't need to disable anything. -- Jörn Zaefferer http://bassistance.de While you can do that, making the button disabled is a good visual indication (in addition to the error message(s)) and prevents the click in the first place. There may be other reasons you may want to call a function when everything is OK, or there is an error (maybe highlight /animate the fields with errors?). ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Security with Ajax
On 11/03/07, JQuery - SimDigital [EMAIL PROTECTED] wrote: I need to protect the data generated from my site, just allowing to access authorized sites. Ex.: Authorized Site1 Allowed to access/include the file http://www.mysite.com/business.php. Authorized Site2 Allowed to access/include the file http://www.mysite.com/business.php. Unregistered Site Unallowed to access the file. It will return a blank page. It need to be like google maps API, that don´t allow unregistered sites to use the API if it isnt registered. I don´t know how to solve this. What path i need to follow? This may be a good place to start: http://devzone.zend.com/node/view/id/1616 It involves generating an Ajax key on your server, stored in a session variable and sent to the client (. e.g. myAjaxKey.php ?php $_SESSION['ajaxKey'] = md5(mktime()); ? var ajaxKey = '?php echo $_SESSION['ajaxKey']; ?'; Web page: script type=text/javascript src=myAjaxKey.php/script script type=text/javascript $.ajax({ type: POST, url: some.php, data: name=Johnlocation=BostonajaxKey= + ajaxKey, success: function(msg){ alert( Data Saved: + msg ); } }); /script ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Security with Ajax
On 12/03/07, Mikael Noone [EMAIL PROTECTED] wrote: I dont think that using javascript for security will solve the problem, try using php instead. Since javascript is run from the client, it can be manipulated easily. Kindest Regards, Mikael. It is using PHP (or ASP.NET, CF etc). The key is generated on the server and sent to the client for use within the request. They key will change frequently (as it could be generated by a combination of website address, ip, session id, time etc) - i.e. different for each session. If the user copied the JavaScript and put it on their own domain, it would no longer work (as the key will then be invalid). i.e. ?php if ($_SESSION['ajaxKey'] == $_POST['ajaxKey']) doStuff(); else denyAccess(); ? On 3/12/07, Sam Collett [EMAIL PROTECTED] wrote: On 11/03/07, JQuery - SimDigital [EMAIL PROTECTED] wrote: I need to protect the data generated from my site, just allowing to access authorized sites. Ex.: Authorized Site1 Allowed to access/include the file http://www.mysite.com/business.php. Authorized Site2 Allowed to access/include the file http://www.mysite.com/business.php. Unregistered Site Unallowed to access the file. It will return a blank page. It need to be like google maps API, that don´t allow unregistered sites to use the API if it isnt registered. I don´t know how to solve this. What path i need to follow? This may be a good place to start: http://devzone.zend.com/node/view/id/1616 It involves generating an Ajax key on your server, stored in a session variable and sent to the client (. e.g. myAjaxKey.php ?php $_SESSION['ajaxKey'] = md5(mktime()); ? var ajaxKey = '?php echo $_SESSION['ajaxKey']; ?'; Web page: script type=text/javascript src=myAjaxKey.php/script script type=text/javascript $.ajax({ type: POST, url: some.php, data: name=Johnlocation=BostonajaxKey= + ajaxKey, success: function(msg){ alert( Data Saved: + msg ); } }); /script ___ 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] Validation help with Date Selector
On 12/03/07, Rick Faircloth [EMAIL PROTECTED] wrote: There may be other reasons you may want to call a function when everything is OK Can you give some examples of what you're thinking about? Maybe performing an auto submit (although that would put extra load on the server) or showing another form (i.e. in a questionnaire if question 1 - 3 are answered, show questions 4 - 6)? or there is an error (maybe highlight /animate the fields with errors?). I'm placing individual error messages above each field when there is an error... do you think I should do something more? Thanks for the feedback... Rick It is probably fine when you have only a few fields to validate and you make it obvious about the error. But applying animation fx may make fields stand out more when there are a lot on the page (e.g. fade in a red background on the container the field is in, then fade out to the original background after a second or so). Like how it does in Jörn's API browser, (when you click on one of the items on the left) but for slightly longer. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to tell numerically which sibling element I've triggered?
On 12/03/07, Matt [EMAIL PROTECTED] wrote: Hello, all jQuery gurus. I deeply appreciate all the help people provide one another on this list, and how generously the experts contribute their time and wisdom to newcomers such as myself. I finally have an issue I'd like some help with myself, and any assistance would be welcome. I have an unordered list like this: div id=articlesIndex ul lia href=article01.phpFirst Article/a/li lia href=article02.phpSecond Article/a/li lia href=article03.phpThird Article/a/li /ul /div I cannot figure out how (or whether) I can use jQuery to read which LI element has just been clicked as a numeric index. Here is a simplified example code: $(document).ready( function() { $('#articlesIndex li a').click( function() { alert(You just clicked list item number: ); return false; // prevents the hyperlink from firing } ); } ); Now how do I pass the number so that the alert You just clicked list item number: is followed by the number just clicked on? When you click on the hyperlink on the second list item, I want to read that index so jQuery can know that I've just clicked sibling number 1 out of the possible siblings 0,1, and 2. So it would be something like: alert( You just clicked list item number: + $this.myNumericIndex() ); Which is obviously complete gibberish since no such thing exists, but you get the idea--I want to know what DOES exist that I can use there. I can't make heads or tails of the index() method and don't know whether it's relevant here. (I know I could just assign id's to each of them and simply reference their id attribute, but that's a pain in the butt and requires extra inelegant code.) Any suggestions? each has a parameter which is the index: $(document).ready( function() { $('#articlesIndex li a').click( function(i) { alert(You just clicked list item number: + (i + 1)); return false; // prevents the hyperlink from firing } ); } ); ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to tell numerically which sibling element I've triggered?
On 12/03/07, Aaron Heimlich [EMAIL PROTECTED] wrote: On 3/12/07, Sam Collett [EMAIL PROTECTED] wrote: each has a parameter which is the index: $(document).ready( function() { $('#articlesIndex li a').click( function(i) { alert(You just clicked list item number: + (i + 1)); return false; // prevents the hyperlink from firing } ); } ); Except that it doesn't (to my knowledge) get passed to event handlers. The first parameter of an event handler is the event object. -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com Should have been: $(document).ready( function() { $('#articlesIndex li a').each( function(i) { $(this).click( function() { alert(You just clicked list item number: + (i + 1)); return false; // prevents the hyperlink from firing } ); } ); } ); ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Please add a basic debug function to the jQuery core...
On 12/03/07, Jörn Zaefferer [EMAIL PROTECTED] wrote: Daemach schrieb: I already have a plugin - it contains the code I put in my first email. I just don't want to have to add that line or remember to remove it. Adding the function directly to jquery will not affect the file size significantly and it will always be available. If I ever decide to switch to safari or opera (not bloody likely) I'll add a function that tests for the availability of a console. Until then this works for me. You could modify jQuery's ant build and add that plugin for development builds of jQuery. -- Jörn Zaefferer http://bassistance.de Maybe there could be an additional download in the future? i.e. jQuery Compressed, Uncompressed and Debug. The Debug version would have code that would help with debugging (and perhaps log to the console whenever events are fired, without the developer needing to add more code) and also work cross-browser? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Validation help with Date Selector
On 11/03/07, Rick Faircloth [EMAIL PROTECTED] wrote: onInvalid: function(form) { $(form).find([EMAIL PROTECTED]).attr(disabled, disabled); }, onValid: function(form) { $(form).find([EMAIL PROTECTED]).attr(disabled, ); } That looks good to me! Hopefully that will work. I'm using Jorn's plug-in in debug mode, which is supposed to prevent submission whether the form fields are correct or not. However, since I'm using other script which works in an Ajax manner to submit the entries to another page, I think that's interfering somewhat with Jorn's plug-in and its control over the process. I'll tinker around with your methods above and see what happens. Hopefully, Jorn will show up and provide us some assistance, too... Thanks! Rick It won't work as is, because the validation plugin does not offer this functionality at the moment. More a suggestion to Jörn than actual working code (and it may work if it is implemented). -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sam Collett Sent: Saturday, March 10, 2007 7:02 PM To: jQuery Discussion. Subject: Re: [jQuery] Validation help with Date Selector I think to do that, the validation needs two more callbacks, e.g. onValid, onInvalid. So the following is possible: onInvalid: function(form) { $(form).find([EMAIL PROTECTED]).attr(disabled, disabled); }, onValid: function(form) { $(form).find([EMAIL PROTECTED]).attr(disabled, ); } Perhaps Jörn may be willing to add this? ___ 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, Thickbox, and tracking scripts
On 08/03/07, Dan Shields [EMAIL PROTECTED] wrote: I am trying to use jQuery and thick box to replace my existing popups. The one thing is that on these popups, I have tracking scripts that are pointed to outside domains and it seems to cause my javascript to error out saying uncaught exception: Permission denied to call method XMLHttpRequest.open I see from everywhere after googling that this is from trying to pull in content from another domain but really I'm not doing that I'm just pulling in another page from my server, which has tracking scripts pointing to other domains. Perhaps loading them via an iframe (instead of inline) would help? Unless you are doing that already (in which case I have no other suggestions). ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Validation help with Date Selector
On 10/03/07, Rick Faircloth [EMAIL PROTECTED] wrote: Thanks, Sam! That will be much more flexible than my approach. I've often found that when I first begin to learn coding techniques, that I end up learning the long-hand version first and getting that working, then it's easier to see ways to move to short-hand. I'm learning CSS the same way. I use it inline a lot now, but sooner or later, I'll begin to see how creating classes, etc, will make everything more flexible and end up writing much less code. Do you have any idea how I might solve the problem mentioned below about disabling the submit button while entry errors exist and enabling the button when all field entries are satisfactory? I can't get a handle on that one. Rick I think to do that, the validation needs two more callbacks, e.g. onValid, onInvalid. So the following is possible: onInvalid: function(form) { $(form).find([EMAIL PROTECTED]).attr(disabled, disabled); }, onValid: function(form) { $(form).find([EMAIL PROTECTED]).attr(disabled, ); } Perhaps Jörn may be willing to add this? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Options for Validation...
On 08/03/07, Rick Faircloth [EMAIL PROTECTED] wrote: I don't have much of a clue how to code what you mean with the errorPlacement function: Here's what I tried, which didn't work...everything else runs fine without it... remember, unfortunately you're helping someone who has just begun to work with jQuery and the plug-ins... :o) $.validator.defaults.debug = true; $().ready(function() { // validate Mortgage_Calculation_Form form fields on blur $(#MC_Form).validate({ errorPlacement: function(error, #Principal) { error.insertBefore(#Principal); }, focusInvalid: false, event: blur, rules: { Principal: {required: true}, Interest: {required: true, number: true}, Years: {required: true, number: true} }, messages: { Principal: Please enter the Principal., Interest: {required: Please enter the Interest Rate., number: Please enter a number.}, Years: {required: Please enter the Years., number: Please enter a number.} } }) }); -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jörn Zaefferer Sent: Thursday, March 08, 2007 5:30 PM To: jQuery Discussion. Subject: Re: [jQuery] Options for Validation... Rick Faircloth schrieb: Calling all jQuery/CF'ers… I'm not real satisfied with the error message placement options in Jorn Zaefferer's validation plug-in. I like to place my error messages right above the form field that the error message references. Right now, as I understand it, Jorn's plug-in doesn't allow for that type of placement. Forgot that other message. Well, parts of it. You can customize the error placement! Just implement the errorPlacement function: $(#myform).validate({ errorPlacement: function(error, element) { // do whatever you like with error and the element, eg.: error.insertBefore(element); // - inserts the error before the element, use next() or prev() or parent() on element etc. to navigate through the DOM } }); -- Jörn Zaefferer http://bassistance.de I guess you want everything before Principal? Try this instead: errorPlacement: function(error, element) { $(error).before(#Principal); }, Untested though (I haven't used Jörn's plugin yet, but I think I know how errorPlacement works). ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Options for Validation...
On 09/03/07, Rick Faircloth [EMAIL PROTECTED] wrote: Hi, Sam, and thanks for the reply... With your code, the validation function seems to be working, but the error message is not displaying... And it's not that I want *every* error message to display before #Principal (that's the id for one of the form fields), I want the error message for each form field to display above each form field, as in: #Principal error message. #Principal form field #Interest error message. #Interest form field #Years error message. #Years form field Any other suggestions? Rick I think I got it mixed up: errorPlacement: function(error, element) { $(element).before(error).before(br); }, This should add the error before the element and then a break (so it appears directly above) I guess you want everything before Principal? Try this instead: errorPlacement: function(error, element) { $(error).before(#Principal); }, Untested though (I haven't used Jörn's plugin yet, but I think I know how errorPlacement works). ___ 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] Good datepicker
On 09/03/07, Rey Bango [EMAIL PROTECTED] wrote: Hey guys, I'm looking for a good JS-based date picker. I wanted to use the one in the plugins folder but it doesn't allow for going backwards on the calendar. I need to be able to select any date. Suggestions? Rey -- BrightLight Development, LLC. 954-775- (o) 954-600-2726 (c) [EMAIL PROTECTED] http://www.iambright.com You could always pick a start date in the past: $('selector').datePicker({startDate:'01/01/1900'}); There is also one I used in the past: http://www.dynarch.com/projects/calendar/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Good datepicker
On 09/03/07, Rey Bango [EMAIL PROTECTED] wrote: Hi Alexandre, Yes we're talking about the same plugin but it doesn't go back in time unless you explicitly set the start date to an earlier date. Thats not what I'm looking for. I want arrows that can go back and forth between months. Currently, the plugin will let you go forward from your start date. Rey You could pick a start date and prefill it with today's date: var today = new Date() today = today.getDate() + / + (today.getMonth() + 1) + / + today.getFullYear() $('selector').datePicker({startDate:'01/01/1900'}).val(today); Now what could make the date picker more useful (plus make it useful for other things as well) is make _strToDate and _dateToStr public methods (i.e. so you could do var today = jQuery.datePicker._dateToStr(new Date()) Alexandre Plennevaux wrote: Yes it does i use it in one of my app as a form helper to select a UK formatted date before mysql insert. One of the options is the startdate, which you can set to 1789 if you like If you need help, let me know... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rey Bango Sent: vendredi 9 mars 2007 17:53 To: jQuery Discussion. Subject: [jQuery] Good datepicker Hey guys, I'm looking for a good JS-based date picker. I wanted to use the one in the plugins folder but it doesn't allow for going backwards on the calendar. I need to be able to select any date. Suggestions? Rey -- BrightLight Development, LLC. 954-775- (o) 954-600-2726 (c) [EMAIL PROTECTED] http://www.iambright.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- BrightLight Development, LLC. 954-775- (o) 954-600-2726 (c) [EMAIL PROTECTED] http://www.iambright.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Wich element triggered an event?
On 09/03/07, Abel Tamayo [EMAIL PROTECTED] wrote: Hi all. I'd like to know if there's a standard, easy way to determine with element triggered an event. I'm pretty sure there is, but can't find it in google. Maybe an atribute in the e parameter received by the function like: $(p).bind( click, function(e){ console.log(e.TRIGGER); // This trigger attribute of the element e is the one that started the action. } ); I thinks it is e.target. In the past you had to do target = e.target || e.srcElement (or something similar), but I think jQuery was changed to prevent the need. So, is there an easy way? Thanks. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Validation help with Date Selector
On 09/03/07, Rick Faircloth [EMAIL PROTECTED] wrote: Well.. thanks to everyone's help, especially yours, David, I've finally got a perfectly working solution that is based on your solution, David. Thanks to Jorn and Sam, too! (Just a note: I've still got one problem to solve. When a form field has been left empty and the error message appears, a user can still click the Calculate button and submit the form, which causes a ColdFusion error due to the lack of the data to make the payment calculation. How can I render the button invalid or unclickable if there's an error showing?) You can see the finished work at http://bodaford.whitestonemedia.com Click on a photo on the home page to go to the Featured Properties page. Scroll down until you see the Click here to Calculate Mortgage. line. Then you should see the form. Here's the way I had to modify the code for the plug-in: errorPlacement: function(error, element) { if(element.attr('id') == Principal) { error.appendTo(#principal_error); } else if(element.attr('id') == Interest) { error.appendTo(#interest_error); } else if(element.attr('id') == Years) { error.appendTo(#years_error); } }, A more generic way: errorPlacement: function(error, element) { error.appendTo(# + element.attr('id') + _error); }, Slight change in HTML: td/tdtd id=Principal_error/td Doing it this way will mean you don't have to edit your JavaScript for the error placement if more fields are added. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Manipulating the contents of an iframe
I have a parent window that is contains an iframe (containing a calendar) that I want to work with. Both are in the same domain (and folder) and both include jQuery. When I click on a day (i.e. a table cell), I want to get the id (which contains the date) to set the value of a text box in the parent form. I can get it to work with Firefox, but not Internet Explorer. Also, when the iframe page changes (i.e. I click a link within it), the load event isn't fired again in IE (but is in Firefox). This is what I have in the parent document: $( function() { var shifts = $(frames[shifts]||#shifts); shifts.load( function() { alert(iframe loaded); // fires each time the iframe loads in Firefox, but not IE var d = this.contentDocument; if(!d) d = this.document; // IE else d = d.defaultView; // firefox var days = d.$(td.shift); days.each( function() { var self = $(this); var text = self.text(); self.empty().append(a href='#').find(a).append(text).click( function() { alert(selected + this.parentNode.id); return false; } ); } ) } ); } ) Perhaps in a future version of jQuery, it will do this transparently, i.e. var myiframe = $(#myiframe); myiframe.load( function() { var d = this.document; d.$(a).click(function(){return false}); } ) ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] rewriting generic ajax jQuery style
On 05/03/07, Jim Wharton [EMAIL PROTECTED] wrote: Hi, I'm trying to change a bunch of handwritten Ajax stuff to use jQuery's methods. (I figure, if I'm already including the jquery.js file, I may as well use the heck out of it.) My current code sends a request to a php page and gets back an xml result I do the standard way of creating a request object(try/catch for MSXML vs XHR) here is the code to create my request and callback: var http = createRequestObject(); //this just references that object I just created. function ajax ( url, callback ) { http.open ( 'get', url, true ); http.onreadystatechange = callback; http.send(null); } function sendRequest() { var url = getItems.php?cat_id= + idsource; ajax( url, handleInfo ); } my handleInfo function does a nice for loop based on an array(object) and generates table html for each record: function handleInfo() { if (http.readyState == 1) { //document.getElementById(itemtable +idsource).innerHTML = 'h1Loading.../h1' } if (http.readyState == 4) { if (http.status == 200) { var xmlDoc = http.responseXML.documentElement; var output; output = 'tabletheadtrthItems Available/th/tr/theadtbody'; // Create table rows for each record for (var i=0; i xmlDoc.childNodes.length; i++) { var linkId = xmlDoc.getElementsByTagName('item_id').item(i).firstChild.data; output += 'tr'; output += 'td'+linkId; output += 'tda href=itemdetail.php?item_id='+linkId+' '+xmlDoc.getElementsByTagName('item_name').item(i).firstChild.data+'/a/td'; output += '/tr'; } output += '/tbody/table'; document.getElementById(itemtable +idsource).innerHTML = output; } } } Ok, fairly generic routine stuff. Only problem is, I can't bend my mind around the way to do it in jQuery!!! I have started playing around with the .get method: $(document).ready(function() { $('#resultcontainer').accordion(); $(dt).click(function(){ idsource = $(this).attr(id); $.get(getItems.php, {cat_id: idsource}, function(xml){ //build a table from xml results. var output = 'tabletheadtrthItems Available/th/tr/theadtbody'; var xmlDoc = xml.documentElement; //create rows for each result. for (var i=0; ixmlDoc.childNodes.length; i++) { var linkId = $(item_id, xmlDoc).item(i).firstChild.data; output += 'tr'; output += 'td'+linkId+'/td'; output += '/tr'; } output += '/tbody/table'; $('#itemtable'+idsource).html(output); }); }) }); but this seems to cough up errors about linkId not being a function. Am I at least on the right path? What this code does is everytime one clicks on a dt element, it sends the request based on the id (just a number) then it submits the ajax request. I'm really not sure at all how to deal with the object it returns... so that's why you see me treating it just like I would any other xml object. I'd be happy to post all my code but I don't want to suck up a ton of bandwidth... this being my first post and all that. (In a future revision of this code, I'll actually let the accordian wait until the object is returned before I slide it down.) Thanks, -Jim Have you looked at the ajax method? I think this may work: $.ajax({ type: GET, url: getItems.php, data: {cat_id: idsource}, dataType: xml, success: function(xml){ //build a table from xml results. var output = 'tabletheadtrthItems Available/th/tr/theadtbody'; //create rows for each result.
Re: [jQuery] confirm link
On 05/03/07, James Thomas [EMAIL PROTECTED] wrote: Close ... try this: $(a).click(function(){return alertSave($(this).attr(href));}); function alertSave(url) { var dataControl = $('#changedAppointments').attr(value); if (dataControl.length 0) { if (confirm(You have made changes to this date which have not been saved.\n\nAre you sure you want to navigate from this page?)) { document.location = url; return true; } else return false; } } Or an even shorter way: $(a).click(alertSave); function alertSave() { var dataControl = $('#changedAppointments').attr(value); if (dataControl.length 0) { return confirm(You have made changes to this date which have not beensaved.\n\nAre you sure you want to navigate from this page?); } } smeranda wrote: Still no luck, this is what I have: $(a).click(function(){alertSave($(this).attr(href));}); function alertSave(url) { var dataControl = $('#changedAppointments').attr(value); if (dataControl.length 0) { if (confirm(You have made changes to this date which have not been saved.\n\nAre you sure you want to navigate from this page?)) { document.location = url; } else return false; } } James Thomas wrote: You need to return false if you don't want something to happen. so if (confirm('whatever')) { do_whatever(); } else return false; smeranda wrote: When a user clicks a link and a form field currently has data, a confirmation box appears. This is close to working, but if a user clicks 'cancel' the browser still redirects to the a href URL. What am I doing wrong? $(a).click(function(){alertSave($(this).attr(href));}); function alertSave(url) { var dataControl = $('#changedAppointments').attr(value); if (dataControl.length 0) { if (confirm(You have made changes to this date which have not been saved.\n\nAre you sure you want to navigate from this page?)) { document.location = url; } } } -- View this message in context: http://www.nabble.com/confirm-link-tf3350646.html#a9320032 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] get class name
On 05/03/07, Glen Lipka [EMAIL PROTECTED] wrote: If the ID only has one class you can also say: $(#myID[class=foo]).fadeOut(); or var theNode = $(#myID[class=foo]) Also, wouldn't your example work without the IF? $(#myId).is(myClass).fadeOut(); or var theNode = $(#myId).is(myClass) Glen No. 'is' returns true/false, not a jQuery object. You can use filter though: $(#myId).filter(.myclass).doStuff(); If you want to determine whether #myId has a particular class or not use this: if( $(#myId).is(.myClass) ) { // Do stuff... } -- ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Bind event to radio button group
On 03/03/07, Brad Perkins [EMAIL PROTECTED] wrote: Josh, After further testing this doesn't appear to work with IE6 (or Safari). Your technique for binding the radio buttons works in the main page, but it appears that any javascript returned via the ajax call is ignored by IE6 (and also by Safari). BTW, my AJAX stuff is really AJAH (returning HTML). I'm not setting a response type server side. Could that be the problem? -- Brad ps - I notice that all other posts from this list have [jQuery] in the subject. I figured the mailing list automatically included that, but this thread doesn't have it. That happens when you use GMail and are the topic starter. Others do see it prepended to the subject. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] JS Source code Formatter - Anyone know of any good ones
On 02/03/07, harningt [EMAIL PROTECTED] wrote: Tsz Ming WONG wrote: maybe http://astyle.sourceforge.net/ ? you might need to tweak the settings for javascript. This seems the ideal tool to me, however it completely screws up when dealing w/ function creation.. Ex: /* Desired target for where I work (I prefer inline braces, since it wastes less space, but I digress.) */ var x = function() { return function() { return 0; } }; Astyle likes to format in this matter: var x = function() { return function() { return 0; } } Which is horrible.. increases nesting depth insanely. (may not show up right because I'm editing in Nabble's text-area -- I find it also inserts spaces even though I tell it not to: AStyle.exe -beyFTE myfile.js It's a shame there are no free command line utilities (that don't have a bug like that) for code formatting like how Visual Studio can do it (specifying spaces or tabs, brackets on newlines or not, etc). Tidy works with HTML, but you can't tell it to use tabs instead (i.e. the developer(s) is basically forcing his coding style onto the users of the software), it complains about malformed documents, and it outputs more than just the tidied HTML when it is finished. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] ANNOUNCE: Thickbox Reloaded alpha
On 28/02/07, agent2026 [EMAIL PROTECTED] wrote: Well for one, it's 17k packed standalone whereas my heavily modified Thickbox is just 6k packed. Small file size was one of the top reasons Cody made Thickbox in the first place, and it's definately a very important factor for me. Adam It is only in alpha stage at the moment, so perhaps it may shrink in size by beta or final release. The file size has probably increased because it has been made more flexible as a plugin (I would call ThickBox a pseudo-plugin as you couldn't do $(a.foo).thickbox()). The original Thickbox, while good, was not very flexible - the page had to modified to get it to work (via querystring to add with and height etc, which I think was invalid as well), elements added after the page was load required extra work (e.g. $(a.thickbox).unbind(); TB_init()), not smooth when you scrolled (would be better if scrolling was disabled instead), CSS issues etc. Also, you had to heavily modify thickbox to get it to work for you (infact I use a version you posted a while back) - you should never need to do that for a plugin. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] ANNOUNCE: Thickbox Reloaded alpha
On 28/02/07, Alexandre Plennevaux [EMAIL PROTECTED] wrote: as for feature, proportional dimensions is a must IMO. There is no sense fixing width and height of thickbox in today's multitude of screen sizes... What exactly do you mean by that. Currently if an image is too large for the viewport it gets resized. Is it that? I took that from the current Thickbox without any changes. I mean with TB, you specify its width and height by giving pixel values (width=600height=400 for example). This is wrong: if the users has a 2 pixel wide monitor (or a very small screen), TB should use whatever screen assets the user has. That is why width=90% is better. Perhaps there should be min-width/height (and max while you are at it) if you are going to use percentages. Also how would you indicate it (perhaps width=90height=90unit=percent)? Is it to be % of screen or window (I assume window)? I can't imagine someone having a monitor that big. If they did, they probably would not have the browser maximised (as most sites would look bad at very high resolution). Those with small screens probably have a portable device, which thickbox won't work in anyway. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Klaus Hartl Sent: mercredi 28 février 2007 14:49 To: jQuery Discussion. Subject: Re: [jQuery] ANNOUNCE: Thickbox Reloaded alpha Alexandre Plennevaux schrieb: If filesize is to be TB biggest advantage, personally in fact i rarely need to be able to launch a TB with iframe, ajax and images on the same page, or even Application. I guess i'm not the only one to choose before hand at design time how my app will use TB (ajax/iframe) to display interfaces. I would therefore love to have 3 different thickbox plugins, so 3 different files. If i need to mix, just adding the script source link to the related TB version would enable me to. script src=plugin.thickbox.images.js type=text/javascript/script script src=plugin.thickbox.ajax.js type=text/javascript/script script src=plugin.thickbox.iframe.js type=text/javascript/script this would also enable to build more functionalities for specific uses (gallery, zoom, prev/next only apply to images). I just wrote in reply to Sam, that I'm thinking about making TR modular exactly like that. The basis is already there. On the other hand, for the Ajax example it just saves us 5 lines of code... as for feature, proportional dimensions is a must IMO. There is no sense fixing width and height of thickbox in today's multitude of screen sizes... What exactly do you mean by that. Currently if an image is too large for the viewport it gets resized. Is it that? I took that from the current Thickbox without any changes. thank you! Thank you for feedback. And all the others! I hope we can build a Thickbox everybody (ok, hopefully most of us) is satisfied with! And while I'm at it, thanks to cody for letting us do this! -- klaus -- klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Ce message Envoi est certifié sans virus connu. Analyse effectuée par AVG. Version: 7.5.447 / Base de données virus: 268.18.4/705 - Date: 27/02/2007 15:24 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Tabs plugin / CSS problem
On 27/02/07, Klaus Hartl [EMAIL PROTECTED] wrote: Wilfred Nas schrieb: Klaus, you are right, my fault (too lazy with copy and pasting as it is still early) but Doctype does matter when rendering, see http://www.quirksmode.org/css/quirksmode.html Yes I know - thats why I pointed out, that the xml declaration will put IE into quirks mode again :-) -- Klaus In IE it doesn't make a difference in rendering whether you use HTML4 or XHTML as the DOCTYPE. You could probably even have HTML 3 as the DOCTYPE and still have it render the same. Mozilla on the other hand, does sniff DOCTYPE: http://developer.mozilla.org/en/docs/Mozilla's_DOCTYPE_sniffing 3 modes: Full Standards Mode, Almost Standards Mode (only for HTML 4 / XHTML 1.0 Transitional / Frameset) and Quirks Mode. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] ANNOUNCE: Thickbox Reloaded alpha
On 26/02/07, Sam Collett [EMAIL PROTECTED] wrote: On 26/02/07, Klaus Hartl [EMAIL PROTECTED] wrote: Hi jQuerians, I just committed what I would call Thickbox Reloaded alpha version. It may look the same pretty much, but is a complete rewrite. Here's what's new: * Chainable method to bind Thickbox to links and forms (makes it easy for content that gets loaded/created later on). * Totally unobtrusive: no classes needed for links, no params in URL. * Confirm type Thickbox, triggered automatically by binding Thickbox to a form. If yes the form gets submitted unless a custom callback is defined (for example for Ajax submitting) * Automatic type detection depending on type of element, respectively on type of link: image: href is an image content: href is a hash ajax: href is internal and not image iframe: href is external and not image confirm: element is form * Improved UI blocking (Thanks to Mike Malsup and the BlockUI plugin) * Options for width/height are now passed in as settings object literal or are stored as default values via $.thickbox.defaults({ width: 300, height: 400 }) * Options top/left positioning (instead of centering), unit defaults to 'px' * Easier skinning: The look is completely separated into an extra style sheet * Scrolling via mousewheel/touchpad is blocked * Lets you define custom animations for showing the modal window via settings * Requires jQuery 1.1.1 Maybe I have forgotten something. I thought of including the required style sheets dynamically, but you would still have to include the path somehow. You can also have a look here (besides repository): http://stilbuero.de/jquery/thickbox_reloaded/ Please note that I haven't tested in other browsers than Firefox yet. I just thought I'd like to request some feedback/code review first! -- Klaus Looking good so far. A couple of suggestions: A way to specify a link is to an image (perhaps by className). At the moment, it just checks if the image has one of the common extensions. It will fail if the image being linked to is dynamically generated (and thus does not contain the extension) - i.e. /showphoto.ashx?ContactID=23. The content type may not be known beforehand, but it is certain to be an image. Long titles. Sometimes titles can be very long (especially if someone else is supplying it), and when they are, you can't see all the text. Perhaps the height of the title bar should by dynamic rather than fixed. More a CSS issue than anything, but is would be good if the CSS supplied with the plugin took this into account. This is what worked for me: #tb-title-bar { padding:0pt 0pt 0pt 6px; } #tb-title-bar h2 { margin:4px 14px 3px 0; /* 14px is to take into account the close image */ } #tb-content { /* removed all css */ } Another suggestion: You can't use the tab key in the thickbox (except for external content, which is in an iframe anyway). You may want to add an example of a form within a thickbox (I've had to do some workarounds to get forms to work in ThickBox 2.1) ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] ANNOUNCE: Thickbox Reloaded alpha
On 27/02/07, Klaus Hartl [EMAIL PROTECTED] wrote: Alexandre Plennevaux schrieb: Question: will the next version of TB support multiple thickboxes (one on top of the other) ? Ugh. No, at least not yet. To make it most efficient, the window gets created once and is then reused. That said, currently Thickbox 3 is not designed to do that. Was it possible before? Is this a wildly requested requirement? -- Klaus Perhaps that may be more appropriate for a plugin to Thickbox as I guess this may significantly increase the file size (which hopefully will be similar in size to what ThickBox 2.1 is now)? While it may be useful, I think in most cases thickboxes won't be used to open other thickboxes. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] problem with edit in place on HTML coding.
On 27/02/07, Mark [EMAIL PROTECTED] wrote: i`m trying to edit the whole tag. and i can`t post any samples online.. i don`t have any sites online.. i do have some free subdomains somewhere but i hardly know where i left them :P perhaps in the future.. You could upload them to Google Pages (http://pages.google.com/). That's what I did in the past before it was blocked from work. Not sure how many others on this list have Google Pages blocked. 2007/2/27, Mika Tuupola [EMAIL PROTECTED]: On 27 Feb 2007, at 01:47, Mark wrote: i have a edit in place thing now and i have this text: div class=\admin_link\#INCLUDE#/div when you click on the the text field pops in BUT the content is suddently different.. the content now is: lt;div class=admin_linkgt;#INCLUDE#lt;/divgt; sorry, i forgot to mention that.. i`m using the jEditable plugin. Ok. To be clear. Is the text you are trying to edit #INCLUDE# or are you trying to edit the whole html tag div class=\admin_link \#INCLUDE#/div ? Maybe you can post some example code online? -- Mika Tuupola http://www.appelsiini.net/~tuupola/ ___ 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] Another PNG transparency thingy for IE
On 27/02/07, Weaver, Scott [EMAIL PROTECTED] wrote: I am currently working on building a blog to house these kinds of code odds and ends. Will ping bing back when it is up. -scott You'll ping the list when you have the PNG blog up then? There seem to be several solutions to PNG transparency (some for background image, some for img, CSS only, plugin activated etc), which can be hard to keep track of. It does seem like PNG Alpha Transparency in IE7 was just a hack job as it interferes with opacity filter effects (which it shouldn't) - i.e. ClearType issues with fadeIn/out. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [-Stash-] Sent: Tuesday, February 27, 2007 5:07 AM To: discuss@jquery.com Subject: Re: [jQuery] Another PNG transparency thingy for IE Any chance of a URL with an example of this being used? Thanks :) Luke -- View this message in context: http://www.nabble.com/Another-PNG- transparency-thingy-for-IE-tf3295297.html#a9178908 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] problem with edit in place on HTML coding.
On 27/02/07, Mark [EMAIL PROTECTED] wrote: yea oke.. but do you guys have any idea how to solve this issue? in php it would be: html_entity_decode() but that doesn`t work in javascript.. besides the fact that i would need to edit the plugin and i have no idea where i need to edit it.. :( Perhaps not the best way to do it, but you could try replacing self.revert = jQuery(self).html(); with self.revert = jQuery(self).html().replace(/gt;/g,).replace(/lt;/g, ); Not tested though. 2007/2/27, Sam Collett [EMAIL PROTECTED]: On 27/02/07, Mark [EMAIL PROTECTED] wrote: i`m trying to edit the whole tag. and i can`t post any samples online.. i don`t have any sites online.. i do have some free subdomains somewhere but i hardly know where i left them :P perhaps in the future.. You could upload them to Google Pages (http://pages.google.com/). That's what I did in the past before it was blocked from work. Not sure how many others on this list have Google Pages blocked. 2007/2/27, Mika Tuupola [EMAIL PROTECTED]: On 27 Feb 2007, at 01:47, Mark wrote: i have a edit in place thing now and i have this text: div class=\admin_link\#INCLUDE#/div when you click on the the text field pops in BUT the content is suddently different.. the content now is: lt;div class=admin_linkgt;#INCLUDE#lt;/divgt; sorry, i forgot to mention that.. i`m using the jEditable plugin. Ok. To be clear. Is the text you are trying to edit #INCLUDE# or are you trying to edit the whole html tag div class=\admin_link \#INCLUDE#/div ? Maybe you can post some example code online? -- Mika Tuupola http://www.appelsiini.net/~tuupola/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] KICK-BUTT javascript based Zoom feature
On 24/02/07, Rey Bango [EMAIL PROTECTED] wrote: Bah, we're used to it Mike. If you would've been out of line, you know I would've just jumped in and impaled you, jQuery-style. ;o) Rey... You mean like this: var rey = $(#rey); if (rey.finds(#mike).is(out of line)) rey.impales({who: #mike, with: sharp stick}); Back on topic: While jQPanView is similar to this, I am not aware of any plugins that do this. I'm guessing you would probably have two images, but they would have to be to scaled with an image editor (having one big image may end up being scaled badly by the browser (i.e. what looks big, may not look good if it is simply resized without any filtering applied). Michael Geary wrote: ...and if I seem too much like a smart aleck today, my apologies! No offense intended. I was just having some fun with the juxtaposition of that URL is busted and anyone know how to accomplish this in jQuery... :-) *From:* Michael Geary The actual code for the close-up effect would be different from that, but the code I posted may help point toward the solution. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- BrightLight Development, LLC. 954-775- (o) 954-600-2726 (c) [EMAIL PROTECTED] http://www.iambright.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery.com site Question / Suggestion
On 24/02/07, Kenneth [EMAIL PROTECTED] wrote: Seeing as there's a number of quality API helpers and such for jQuery, I was curious if there are any plans to have them added to the site, say perhaps a new sub-section under documentation? I hope they aren't already there or I will feel like a void(0) :p I know some of them have been covered in the blog, however I think when people need help, the blog probably isn't a candidate for answers. What I am thinking of is things like: * the jQueryHelp.exe from Sean O * the PDF API from Ben Nadal * the great reference sites (visualquery, api-draft, api-browser...I miss any?) * and probably tons more that I have missed If it's simply a matter of editing the wiki I wouldn't mind doing it myself, however I'd like feedback about such a thing first (thus this email)would hate to put work on it if it's already being addressed. p.s. once again, my apologies if I am overlooking something! I have a list of sites that offer the documentation in various forms: http://webdevel.blogspot.com/2007/01/jquery-documentation.html ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How can I create a (style) .class dynamically?
On 23/02/07, Benjamin Sterling [EMAIL PROTECTED] wrote: well, you can append to the head, example: http://ov-staging.informationexperts.com/e.htm script type=text/javascript $(document).ready(function(){ $('head').append('stylebody{background:#000;}/style'); }); /script This does not work in the IEs tho (6, 7), but I am sure something like that is possible with some tweak. It does work in opera 9 and ff2 -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com I have a function that does that (although it has not been tested in Opera 9): http://webdevel.blogspot.com/2006/06/create-css-class-javascript.html ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] BlockUI like plugin for divs
On 23/02/07, Mike Alsup [EMAIL PROTECTED] wrote: Just an issue/small question though, in Safari, the select-tags gets dimmed for just an instant, and then shine through the block, is this a little bug? Thanks for the feedback, Andreas. I'm using a z-index of 500 for the iframe, perhaps that's not high enough in Safari? Anyone know? The full page blocking uses an iframe with z-index of 1000. Does that example work in Safari? Mike Perhaps there should be the ability to change the z-index for the full page blocking as well? I notice you use 1000, 2000 and 3000 - wouldn't 1000, 1001, 1002 be just as good? I do find it odd when such high z-indexes are used - especially since it is extremely unlikely you will have that many layers (I can't imagine using more than 10). I wonder what is the highest z-index each browser can take? I suppose it's because CSS can often be copied and pasted from other sites, and not too much thought put into this aspect (i.e. it works, so why change it). Pity there isn't a way (that I know of) to find out which element has the highest z-index. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] PNGs in IE
On 22/02/07, schnuck [EMAIL PROTECTED] wrote: anyone knows of a jquery plugin that fixes PNG transparency in IE 5.5, 6? or any ideas please? tia, s -- There is a plugin here: http://nemoweb.com.au/jquery/IEPNGHack/take3.html ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery API in PDF Format
On 23/02/07, Rey Bango [EMAIL PROTECTED] wrote: Hey guys, For all of those that would like to get a PDF version of the jQuery API, Ben Nadal (ColdFusion guru and recent jQuery convert) has offered one up. Visit his post here to see how he did it: http://www.bennadel.com/blog/544-Printing-The-Entire-jQuery-API-As-A-PDF-Using-CFDocument-And-XML-Parsing-.htm and you can get the PDF here: http://www.bennadel.com/resources/uploads/jquery_documentation.pdf Be sure to give leave him a thank you comment on his blog. Thanks Ben!! Rey... Have updated my post listing different versions of the documentation (on there is also links to another PDF of the API and PDF cheat sheets (although they are out of date, there are links to updated HTML versions in the linked blog post) ). http://webdevel.blogspot.com/2007/01/jquery-documentation.html ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Reference to newly inserted item?
On 22/02/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, If I have $(this).parents(div.sidebarToDo).find(td.sidebarText).empty().append('input type=text value= size=10 class=editableItem'); What is the best way to get a reference to the newly created text field? Note that it does not have an ID and I would prefer a more generic way of finding it other than input.editableItem because on PC IE 6, if I insert multiple text fields, like the above, this call ... $(this).parents(div.sidebarToDo).find(input.editableTDItem); only returns a correct reference for the first time a textfield is added. I cant get the most recent addition with the above call if there had been text fields added in the past. Thanks, please let me know what info I can provide to make this question more clear, - Dave You could try this: var editableitem = $('input type=text value= size=10 class=editableItem'); $(this).parents(div.sidebarToDo).find(td.sidebarText).empty().append(editableitem); editableitem.change(checkText); ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery and Jack Slocum's Ext
On 20/02/07, Jörn Zaefferer [EMAIL PROTECTED] wrote: John Resig schrieb: Hi Everyone - Today, we're proud to announce that the jQuery Project and Jack Slocum's Ext Project, have partnered to integrate the amazingly lightweight and powerful jQuery framework with Ext's awesome UI library. This collaboration will greatly enhance the capabilities of both projects and expand the functionality available to developers using the jQuery JavaScript Library and the Ext UI component suite. For anyone wondering if any jQuery plugins will be replaced by Ext components: While that is possible, there are still good reasons to use jQuery plugins. Most are very lightweight, easy to customize and extend, and most important: unobtrusive. So if you are looking for something to use on a normal website, jQuery's plugins are a good choice. If you are looking for components for a rich web application, Ext components offer a much richer experience. I'm looking forward to the first Ext-release with jQuery. -- Jörn Zaefferer http://bassistance.de Can they even be used in a way to degrade nicely? All the examples I have looked have don't have a fall-back if you disable JavaScript. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] History Plugin API
On 21/02/07, Klaus Hartl [EMAIL PROTECTED] wrote: Chris Ovenden schrieb: Hi All I have searched Google and my archives of this list, and can't find an API for the history plugin. Is there one, somewhere? Thanks! Chris Chris, you'll find the documentation inline. http://dev.jquery.com/browser/trunk/plugins/history_remote/jquery.history.js?format=txt After all, there is not much API: Enable history for an Ajax driven link: $('a').remote('#output'); Such a link will load content from the URL of its href attribute into an element with the id output. (You can put in any selector suported by jQuery or a DOM element). You still have to activate history: $.ajaxHistory.initialize(); There is an undocumented feature. If you have links that do not load Ajax content but have attached some handler on the click event (for example showing a part of the page) you can history-enable that link as well: $('a').history(); I'll write up a little tutorial as soon as possible. -- Klaus You could always use the jQuery HTML Documentation Generator: http://jquery.bassistance.de/docTool/docTool.html ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to get the ID of the parent node?
On 21/02/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, Following up from a question I asked yesterday, I wanted to get the closest parent DIV given an arbitrary nested element. But when I request the .id of that element, i repeatedly get an undefined message, even though this call, $(this).parent(div.sidebarToDo) yields an object. $('#todoList a.deleteTDItem').each(function(index) { var divId = $(this).parent(div.sidebarToDo).id; alert(divId); // alwasy gives 'undefined' $(this).click = function() { $('#' + divId).remove(); }; }); This is the HTML in question: div class=sidebarToDo width=100% id=dToDo3 table cellpadding=0 cellspacing=0 border=0 width=100% tr tdinput id=cbTdId3 onClick=var textDecor = (this.checked ? 'line-through' : 'none'); $('#textId3').css('text-decoration', textDecor); type=checkbox id=tdcb3 /td td id=textId3 class=sidebarText style=text-decoration: noneStart Work/td td align=righta class=editTDItem href='#'img src=images/edit.gif alt=Edit border=0/a/td td align=righta class=deleteTDItem href=javascript:toggleDiv('dToDo3');img src=images/deleteLink.gif alt=Delete border=0/a/td /tr /table /div Thanks, - Dave You can get the id via attr: $(this).parent(div.sidebarToDo).attr(id) ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] accordion table, instead of an accordion list/menu?
On 21/02/07, Kristinn Sigmundsson [EMAIL PROTECTED] wrote: Thing is that even if you have a callback to the slideToggle and set the display property to table-row, it still comes out wierd... maybe a wrapping div is the best solution? I have tried wrapping with DIV's, but they don't seem to work for me (around tr, tbody and wrapping the contents of cells). I have not come across any method in JavaScript that can slide up/down a row. I am not sure if Prototype or YUI are capable of this. On 2/21/07, rolfsf [EMAIL PROTECTED] wrote: Thanks Karl - I've scoured the threads - it's definitely on the list of hard problems, and labeled unsolved http://docs.jquery.com/HardProblems Karl Swedberg-2 wrote: I haven't tested any, but there have been a few threads on this issue before and one workaround I recall reading about was to temporarily wrap a set of rows in a div before showing and hiding and then remove the div after the effect has completed. If you discover this or some other method works, please post the solution to the list! :) --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Feb 20, 2007, at 11:25 PM, rolfsf wrote: Is there a way around that? Can you get simple animation to work on table rows? I can live with a simple show/hide, but it would be nice to dress it up a little. -- View this message in context: http://www.nabble.com/accordion-table%2C-instead-of-an-accordion-list-menu--tf3264032.html#a9083021 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- —— Med Vänliga Hälsningar Kristinn Kiddi Sigmundsson 0707-971938 —— ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to get the ID of the parent node?
On 21/02/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: ---Original Message--- From: Chris Ovenden [EMAIL PROTECTED] Subject: Re: [jQuery] How to get the ID of the parent node? Sent: Feb 21 '07 16:04 On 2/21/07, SAM COLLETT [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On 21/02/07, [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, Following up from a question I asked yesterday, I wanted to get the closest parent DIV given an arbitrary nested element. But when I request the .id of that element, i repeatedly get an undefined message, even though this call, $(this).parent( div.sidebarToDo) yields an object. $('#todoList a.deleteTDItem').each(function(index) { var divId = $(this).parent(div.sidebarToDo).id; alert(divId); // alwasy gives 'undefined' $(this).click = function() { $('#' + divId).remove(); }; }); This is the HTML in question: div class=sidebarToDo width=100% id=dToDo3 table cellpadding=0 cellspacing=0 border=0 width=100% tr tdinput id=cbTdId3 onClick=var textDecor = (this.checked ? 'line-through' : 'none'); $('#textId3').css('text-decoration', textDecor); type=checkbox id=tdcb3 /td td id=textId3 class=sidebarText style=text-decoration: noneStart Work/td td align=righta class=editTDItem href='#'img src=images/edit.gif alt=Edit border=0/a/td td align=righta class=deleteTDItem href=javascript:toggleDiv('dToDo3');img src=images/deleteLink.gif alt=Delete border=0/a/td /tr /table /div Thanks, - Dave You can get the id via attr: $(this).parent(div.sidebarToDo).attr(id) To spell it out a little more clearly, the API for attributes has changed in jQuery 1.0.3+ and shortcuts like .id() no longer work -- Chris Ovenden [LINK: http://thepeer.blogspot.com] http://thepeer.blogspot.com Imagine all the people / Sharing all the world Thanks, but I'm still getting undefined even though I can an object for my reference to the DIV. Any ideas on how to troubleshoot? here's the JS: $('#todoList a.deleteTDItem').each(function(index) { var divId = $(this).parent(div.sidebarToDo).attr(id); alert($(this).parent(div.sidebarToDo) + id: + divId); $(this).click = function() { $('#' + divId).remove(); }; }); I would have thought that would have worked.. you could always try: $(this).parent(div.sidebarToDo)[0].id I think I have an idea of what you are trying to do - hide the todo item when delete is clicked, and put a line through the task if the checkbox is checked (i.e. task completed). In that case, the HTML can be tidied up a bit (I've removed the id's to improve readability, and also noticed that you had two defined on the checkbox): div class=sidebarToDo width=100% id=dToDo3 table cellpadding=0 cellspacing=0 border=0 width=100% tr tdinput type=checkbox name=completed/td td class=sidebarTextStart Work/td td align=righta class=editTDItem href='#'img src=images/edit.gif alt=Edit border=0/a/td td align=righta class=deleteTDItem href='#'img src=images/deleteLink.gif alt=Delete border=0/a/td /tr /table /div And the following JavaScript used: $('#todoList a.deleteTDItem').click( function() { alert(clicked); $(this).parent(div.sidebarToDo).remove(); return false; }); $('#todoList :checkbox').click( function() { var textDecor = (this.checked ? 'line-through' : 'none'); $(this).parent().find(td.sidebarText).css('text-decoration', textDecor); }); ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to get the ID of the parent node?
On 21/02/07, Sam Collett [EMAIL PROTECTED] wrote: On 21/02/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: ---Original Message--- From: Chris Ovenden [EMAIL PROTECTED] Subject: Re: [jQuery] How to get the ID of the parent node? Sent: Feb 21 '07 16:04 On 2/21/07, SAM COLLETT [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On 21/02/07, [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, Following up from a question I asked yesterday, I wanted to get the closest parent DIV given an arbitrary nested element. But when I request the .id of that element, i repeatedly get an undefined message, even though this call, $(this).parent( div.sidebarToDo) yields an object. $('#todoList a.deleteTDItem').each(function(index) { var divId = $(this).parent(div.sidebarToDo).id; alert(divId); // alwasy gives 'undefined' $(this).click = function() { $('#' + divId).remove(); }; }); This is the HTML in question: div class=sidebarToDo width=100% id=dToDo3 table cellpadding=0 cellspacing=0 border=0 width=100% tr tdinput id=cbTdId3 onClick=var textDecor = (this.checked ? 'line-through' : 'none'); $('#textId3').css('text-decoration', textDecor); type=checkbox id=tdcb3 /td td id=textId3 class=sidebarText style=text-decoration: noneStart Work/td td align=righta class=editTDItem href='#'img src=images/edit.gif alt=Edit border=0/a/td td align=righta class=deleteTDItem href=javascript:toggleDiv('dToDo3');img src=images/deleteLink.gif alt=Delete border=0/a/td /tr /table /div Thanks, - Dave You can get the id via attr: $(this).parent(div.sidebarToDo).attr(id) To spell it out a little more clearly, the API for attributes has changed in jQuery 1.0.3+ and shortcuts like .id() no longer work -- Chris Ovenden [LINK: http://thepeer.blogspot.com] http://thepeer.blogspot.com Imagine all the people / Sharing all the world Thanks, but I'm still getting undefined even though I can an object for my reference to the DIV. Any ideas on how to troubleshoot? here's the JS: $('#todoList a.deleteTDItem').each(function(index) { var divId = $(this).parent(div.sidebarToDo).attr(id); alert($(this).parent(div.sidebarToDo) + id: + divId); $(this).click = function() { $('#' + divId).remove(); }; }); I would have thought that would have worked.. you could always try: $(this).parent(div.sidebarToDo)[0].id I think I have an idea of what you are trying to do - hide the todo item when delete is clicked, and put a line through the task if the checkbox is checked (i.e. task completed). In that case, the HTML can be tidied up a bit (I've removed the id's to improve readability, and also noticed that you had two defined on the checkbox): div class=sidebarToDo width=100% id=dToDo3 table cellpadding=0 cellspacing=0 border=0 width=100% tr tdinput type=checkbox name=completed/td td class=sidebarTextStart Work/td td align=righta class=editTDItem href='#'img src=images/edit.gif alt=Edit border=0/a/td td align=righta class=deleteTDItem href='#'img src=images/deleteLink.gif alt=Delete border=0/a/td /tr /table /div And the following JavaScript used: $('#todoList a.deleteTDItem').click( function() { alert(clicked); $(this).parent(div.sidebarToDo).remove(); return false; }); That should be: $('#todoList a.deleteTDItem').click( function() { $(this).parents(div.sidebarToDo).remove(); return false; }); $('#todoList :checkbox').click( function() { var textDecor = (this.checked ? 'line-through' : 'none'); $(this).parent().find(td.sidebarText).css('text-decoration', textDecor); }); ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Setting a cookie through Jquery
On 21/02/07, Gaston Garcia [EMAIL PROTECTED] wrote: Hi is there a way to set cookies with Jquery? Let's say someone submits a form, I use jquery to process the form through ajax and sends it to php... is there a way to create a cookie with jquery? Maybe in the ajax call I can send the data to PHP and set it through PHP? Anyways, just wanted to know if I can do it directly with jquery. thanks everyone, G. There is a cookie plugin (documentation is in the comments): http://dev.jquery.com/browser/trunk/plugins/cookie/jquery.cookie.js?format=txt ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery and Jack Slocum's Ext
On 21/02/07, Mark D. Lincoln [EMAIL PROTECTED] wrote: Sam, If you are going to use rich components like those found in Ext, does this matter? I am looking at porting large parts of rich client application functionality to the Web and if a user has scripting disabled, the application will not work anyway. Mark D. Lincoln Mark D. Lincoln, Director of Research Development Eye On Solutions, LLC (866) 253-9366x101 www.eyeonsolutions.com If it is an application where JavaScript is a requirement for the user (i.e. you know what the users browser will be and do not need to worry about accessibility), then it is not a problem. One thing I can think of that could degrade is a table of data (e.g. results from a search, or a list of contacts to edit) that simply is processed on the server (e.g. by clicking page links, edit buttons, sorting the results etc) if JavaScript is off and on the client AJAX if it is on. Also, the back button may not work as the user expects - i.e. they search for something, then click back to get what was there before. Or when bookmarking a page, they don't get the same thing when the use the bookmark at a later date. I don't know if Ext is capable of this (I haven't really looked into it in that level of detail). -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sam Collett Sent: Wednesday, February 21, 2007 5:53 AM To: jQuery Discussion. Subject: Re: [jQuery] jQuery and Jack Slocum's Ext On 20/02/07, Jörn Zaefferer [EMAIL PROTECTED] wrote: John Resig schrieb: Hi Everyone - Today, we're proud to announce that the jQuery Project and Jack Slocum's Ext Project, have partnered to integrate the amazingly lightweight and powerful jQuery framework with Ext's awesome UI library. This collaboration will greatly enhance the capabilities of both projects and expand the functionality available to developers using the jQuery JavaScript Library and the Ext UI component suite. For anyone wondering if any jQuery plugins will be replaced by Ext components: While that is possible, there are still good reasons to use jQuery plugins. Most are very lightweight, easy to customize and extend, and most important: unobtrusive. So if you are looking for something to use on a normal website, jQuery's plugins are a good choice. If you are looking for components for a rich web application, Ext components offer a much richer experience. I'm looking forward to the first Ext-release with jQuery. -- Jörn Zaefferer http://bassistance.de Can they even be used in a way to degrade nicely? All the examples I have looked have don't have a fall-back if you disable JavaScript. ___ 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] wrapinner with 1.1.1
On 20/02/07, Oliver Boermans [EMAIL PROTECTED] wrote: Served? Served what? On 20/02/07, John Resig [EMAIL PROTECTED] wrote: I just got served :-( Dave knows something about jQuery that John doesn't (or he forgot about) ;) It does show that there can be several ways to do the same thing in jQuery. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Select box plugin update
Updated my plugin for removing options from a select box. It now takes a regular expression as well as a string and number. http://www.texotela.co.uk/code/jquery/select/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Sites Powered by jQuery
On 19/02/07, Rey Bango [EMAIL PROTECTED] wrote: Hey guys, Just a reminder that we're always taking submissions for new jQuery-powered websites. Please submit them to me or Karl Swedberg ([EMAIL PROTECTED]) and be sure to include: - Link - Name of Company - What the site does - The version of jQuery being used - Where and how jQuery is used For an up-to-date list, please visit: http://docs.jquery.com/Sites_Using_jQuery Thanks again for all of your help! Rey... Perhaps it may be useful if the lists are sorted alphabetically? If they are sorted now, it is not obvious how they are sorted. If (or should I say when ;) ) the lists get much bigger, you may need categories (or an A-Z) on separate pages. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] collapsible menus ~ pixel carnage
On 20/02/07, Karl Swedberg [EMAIL PROTECTED] wrote: Ah yes, that's pretty straightforward. One way to do this would be to put Show/Hide inside a span and use the a for the actual link. HTML: ul id=Menu li id=current_cat h3spanShow/Hide/span a href=accessories.htmAccessories/a/h3 ul li sub menu links/li li sub menu links/li li sub menu links/li li sub menu links/li li sub menu links/li /ul /li /ul jQuery: $(document).ready(function() { $('#Menu ul').hide(); $('#Menu h3 span').click(function() { $(this).parent().next('ul').slideToggle('fast'); }); }); If you want the span to be highlighted somehow on hover, see my most recent tutorial: http://www.learningjquery.com/2007/02/quick-tip-set-hover-class-for- anything Cheers, --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com Or if you want it to make sense when JavaScript is off, remove the span, and add it via jQuery: $(document).ready(function() { $('#Menu ul').hide(); $('#Menu h3').prepend(a class='toggler' href='#'Show / Hide/a ).find(a.toggler).click(function() { $(this).parent().next('ul').slideToggle('fast'); return false; }); }); A bit more code, but it will be styled as a link. On Feb 20, 2007, at 2:31 AM, fatjoez wrote: Hey. Dont worry about my code ay. All I'm basically asking is that in reference to the code pixel carnage provides as an example on his site, is it possible to modify this so that on the same Line as the Menu link which opens/closes a sub menu, is it possible also to add a LINK to an actual page also. So that instead of it being like [clikToToggleMenu]Menu1[/click] sub menu link 1 sub menu link 2 INSTEAD to have it like this [clikToToggleMenu]Show/Hide[/click] [link]Menu1[/link] sub menu link 1 sub menu link 2 Do you understand what I mean? So I want to have like a + / - symbol to expand collapse the menu and on the SAME line to have a link to another menu. Basically so I can show the link to the Parent category also! -- View this message in context: http://www.nabble.com/collapsible- menus-%7E-pixel-carnage-tf3256095.html#a9055526 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Right way to set line-through?
On 20/02/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, How do I use JQuery to set the text-decoration of an element with ID id1 to line-through? Thanks, - Dave The following should do it: $(#id1).css(text-decoration, line-through) ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Test
$(discussion).find(subject:Test).lol(); On 20/02/07, Rey Bango [EMAIL PROTECTED] wrote: haha! That made me laugh. hehehe Rey Kenneth wrote: I believe it's supposed to be: $(this).test(); On 2/19/07, *Rey Bango* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: test email ___ jQuery mailing list discuss@jquery.com mailto:discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Right way to set line-through?
On 20/02/07, Abel Tamayo [EMAIL PROTECTED] wrote: Try this: $(#id1).css(textDecoration, line-through); Remember that when you use the .css function to set a style, it must becapitalized camel-style; that is text-decoration becomes textDecoration and the same happens with backgroundColor, etc... That is only the case if it is not wrapped in quotes, i.e. the following are the same: $(#id1).css(textDecoration, line-through); $(#id1).css(text-decoration, line-through); On 2/20/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, How do I use JQuery to set the text-decoration of an element with ID id1 to line-through? Thanks, - Dave ___ 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] Where's the limitQueue plugin gone?
On 19/02/07, Gerry Tucker [EMAIL PROTECTED] wrote: Anyone know where the limitQueue plugin has gone? I keep getting a 404. Regards, Gerry Google has it in its cache: http://64.233.183.104/search?q=cache:wjk1vbsuMsIJ:jquery.com/docs/Plugins/limitQueue/+limitQueue+jqueryhl=enct=clnkcd=1client=firefox-a So restored it to: http://docs.jquery.com/Plugins/limitQueue I have not tested the code to see if it works though ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Creating an empty jQuery object
On 18/02/07, Danny Wachsstock [EMAIL PROTECTED] wrote: Yehuda: I do know about $('..html/'), but my mother always said Don't hang with those innerHTML kids, you'll learn bad habits. Seriously, I find it very hard to debug the assemble-a-string-and-have-the-interpreter-figure-it-out sort of thing, like innerHTML and eval. I'm not a strict standardista, but using actual code and HTML lets Firebug or the validator find my stupid syntax errors much more easily. I may not be a guru (but have been using it for a long time), but while jQuery does use innerHTML, it does in a way to work around limitations in the browsers. Without it, I don't think you would be able to create select options or table cells/rows via the $(html) method. All of the supported browsers recognise innerHTML and I can't see it going away any time soon, or any new browser shipping without support for it as so many sites rely on it to work. Much like how XHTML strict (served with correct content type) will likely never see widespread adoption. I think HTML 5 (http://blog.whatwg.org/faq/) is more likely to take off IF Internet Explorer 8 adopts it (as it simply expands on what people use now, and is not a complete break from HTML like XHTML 2 is), but as Microsoft are pushing XAML that may not happen. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Google's Summer of Code
On 16/02/07, Sam Collett [EMAIL PROTECTED] wrote: On 16/02/07, John Resig [EMAIL PROTECTED] wrote: Hey Everyone - Google's Summer of Code has just opened up for 2007, and I'd love to have jQuery be a part of it: http://code.google.com/soc/ If you're not familiar with how SoC works, Google pays a number of college students to work on an open source project for an entire summer. This is a great opportunity for the kids, and for the projects that they're supporting. In order to be able to apply, we'd have to come up with a list of things that we'd like them to do. So, I'm asking you (the jQuery community) what you think 1-3 decent coders could do for us for a summer? Some examples of good ideas (which should be expanded upon): - Build or port an unobtrusive charting plugin - Add jQuery support to a popular CMS/Framework - Build some interactive demos for jQuery.com - Add new functionality to Interface We're already working on the following improvements to the web site (so you don't need to ask for these): - A new plugins repository - A new forum area - A customizable download area Feel free to post your suggestions - all are welcome! --John It would be nice if we had more widget style plugins (plus a framework to allow others to create them easily), like the ones you get for YUI and Dojo. Some more (functional and practical) eye candy using Interface would help bring in more users. Whatever is done should really degrade for less capable browser (or without javascript on) as well. Another thing that could be valuable is interpretation of the HTML 5 spec (http://www.whatwg.org/). That would probably take longer that a summer, but parts of it (like the extensions to the input element - http://www.whatwg.org/specs/web-forms/current-work/#extensions) could possibly be done in that time frame. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Smooth Scrolling for same-page links
On 17/02/07, Karl Swedberg [EMAIL PROTECTED] wrote: On Feb 17, 2007, at 4:36 PM, Joel Birch wrote: On 18/02/2007, at 6:13 AM, Karl Swedberg wrote: ok, now that the smooth scrolling has Klaus's blessing :) ... I thought I'd share some code I wrote to make it happen for all same- page links. It takes into account the difference in the way the various browsers treat href. Thanks for sharing that code Karl. Okay, that has me worried that my solution (which I thought worked perfectly) may be flawed in ways I was not aware of. Here is the code I am using to attach the scrollTo plugin to elements that have a class of scrolls: (function($){ $.fn.scrollToHash = function(){ return this.each(function(){ $(this).click(function(){ $(this.hash).ScrollTo(1500,'easeout')[0].blur(); return false; }); }); }; )(jQuery); $(function(){ $(a.scrolls).scrollToHash(); }); Karl, I'm sure there must be issues I am not aware of here. Can you or anyone point them out for me? This code seems to work in all the browsers I have tested including IE6 and IE7, it's the exact code I am using on Preshil, but maybe I am overlooking something. Thanks. Joel. Hey Joel, By using this.hash and limiting it to links with the scrolls class, you seem to have things covered. I put my solution together for a content-managed site in which pages are being created and updated by people with very limited (okay, non- existent) HTML skills. I couldn't expect them to know what they were doing, let alone add a class to the links. Therefore, I had to consider the following: 1. Links to other pages might have the hash as well. Only the ones to the same page should use ScrollTo() 2. The links could be going to an element with id=something or to an anchor with only name=something As Klaus mentioned, I probably could have simplified things a bit by using this.hash. But because I had to account for other things that the editors might do, I had to make the code a bit more complex than yours. If I could have made them add a class to their same-page links, that would have cut down my code significantly, and it would have looked more like yours. I hope that makes sense. I'm typing this while away from home, so my mind isn't totally here. :) --Karl Are you aware of the pathname and host properties? If you use it, you can cut down the code further: $('[EMAIL PROTECTED]#]').click(function() { if (location.pathname == this.pathname location.host == this.host) { if ($(this.hash).length 0 ) { $(this.hash).ScrollTo(400); return false; } else { $linkDest = $([EMAIL PROTECTED] + this.hash.slice(1) +']'); if ($linkDest.length 0) { $linkDest.ScrollTo(400); return false; } } } }); ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Bug in Interface Autocomplete SVN
On 18/02/07, Peter Vulgaris [EMAIL PROTECTED] wrote: Around line 310 of iautocompleter.js there is a line like this: if (/13|27|35|36|38|40|9/.test(pressedKey) jQuery.iAuto.items) { While keycode 9 is the enter key, the regex there also matches for any other keycode with a 9 in it. I know there's a nice looking regex way to fix this but it's Saturday night and I'm fixing it now with this: if ((/13|27|35|36|38|40/.test(pressedKey) || pressedKey == 9) jQuery.iAuto.items) { Peter http://www.vulgarisoip.com I think this will work as well: if (/^(13|27|35|36|38|40|9)$/.test(pressedKey) jQuery.iAuto.items) { ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Cascading data into text input boxes
On 16/02/07, Bruce MacKay [EMAIL PROTECTED] wrote: Hi folks, I have a set of n paired text input boxes (date on; date off). Each is attached to Kelvin Luck's date picker plugin. In most instances, the date off will be 7 days after the date on, and the next date on will be 1 day after the preceding date off. So, to help the user (so that they don't have to select dates for all the pairs of inputs), I want to: 1. for a given pair, populate the date off text input with a date that is 7 days later than the one selected in the date on box 2. for the following pair, populate the date on input with a date that is 1 day later than that of the date off box (in step #1) 3. repeat step #1 and cascade this down through the rest of the pairs. So far I can do step #1. I can't do step #2 as I don't know how to link the changed value of dateoff0 to the function being called in the second line of the code below (i.e. what goes in xx) $('#dateon0').change(function() {if (this.value.length0)$('#dateoff0').attr(value,addTheDate(this.value,7));}); $('#dateoff0').xx(function() {if (this.value.length0)$('#dateon1').attr(value,addTheDate(this.value,1));}); And, of course, I can't do step 3 because I'm hard coding the dateon / dateoff ids - there must be a way to do a loop but I can't work that out either. For completeness, my date-adding function is below. I'd really appreciate some help in filling the blanks in my capability. Thanks, Bruce function addTheDate(ej,df){ var ar=new Array(); ar=ej.split('/'); var myDate = new Date; myDate.setDate(ar[0]); myDate.setMonth(ar[1]); myDate.setFullYear(ar[2]); myDate.setDate(myDate.getDate()+df); var d = myDate.getDate(); var m = myDate.getMonth(); var y = myDate.getFullYear(); var dmy = d + / + m + / + y; return dmy; } I'm at a loss on the xxx bit - how can I take the date that is entered into #dateon, add 7 days to it, and insert it into #dateoff? Try something like this (untested): var to = 5; for(var i = 0; i to; i++) { $('#dateon' + i).change(function() { if (this.value.length0) { $('#dateoff' + i).attr(value,addTheDate(this.value,7)).each(function() { if (this.value.length0) $('#dateon' + (i + 1)).attr(value,addTheDate(this.value,1)); }); } }); } ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] CSS: Wasteful requests when switching input image
On 16/02/07, Brice Burgess [EMAIL PROTECTED] wrote: Klaus Hartl wrote: Brice, I think having two images in the HTML source is pretty ugly. I once did an Image image Replacement for inputs with type image. That way you can easily use pure CSS hovers and use CSS sprites to avoid traffic. It also makes skining much easier, as the appearance is changed in the style sheet again only. If you're interested I'm going to search for the snippet. Or write a post about it. It worked pretty well cross browser. -- Klaus Klaus, A sprite sounds promising non ugly. Vs. changing the background url, you just change the background-(left|right|top|bottom) value.. which I don't think will trigger a request. Keep me posted! :) ~ Brice There is an article on WellStyled.com about this: http://wellstyled.com/singlelang.php?lang=enpage=css-nopreload-rollovers.html ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Google's Summer of Code
On 16/02/07, John Resig [EMAIL PROTECTED] wrote: Hey Everyone - Google's Summer of Code has just opened up for 2007, and I'd love to have jQuery be a part of it: http://code.google.com/soc/ If you're not familiar with how SoC works, Google pays a number of college students to work on an open source project for an entire summer. This is a great opportunity for the kids, and for the projects that they're supporting. In order to be able to apply, we'd have to come up with a list of things that we'd like them to do. So, I'm asking you (the jQuery community) what you think 1-3 decent coders could do for us for a summer? Some examples of good ideas (which should be expanded upon): - Build or port an unobtrusive charting plugin - Add jQuery support to a popular CMS/Framework - Build some interactive demos for jQuery.com - Add new functionality to Interface We're already working on the following improvements to the web site (so you don't need to ask for these): - A new plugins repository - A new forum area - A customizable download area Feel free to post your suggestions - all are welcome! --John It would be nice if we had more widget style plugins (plus a framework to allow others to create them easily), like the ones you get for YUI and Dojo. Some more (functional and practical) eye candy using Interface would help bring in more users. Whatever is done should really degrade for less capable browser (or without javascript on) as well. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] blocking/skinning div cotents
On 16/02/07, Alexandre Plennevaux [EMAIL PROTECTED] wrote: You said: Note that the scrollable div in IE seems to often defeat the overlays I've tried, once the scroll bar appears... I believe that to address this, you have to put an iframe in your overlaying div . Other than that, blockUI is the closest thing to what you are trying to do i believe. That's my 0.0002 eurocent. Good luck, your app sounds wicked! Alex. Having blockUI able to block parts of a page would certainly be useful. Perhaps Mike may implement that? i.e. $.blockUI(); would still function as it does now, but $(#mydiv).blockUI(); would block #mydiv -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Raymond Auge Sent: vendredi 16 février 2007 16:19 To: discuss@jquery.com Subject: [jQuery] blocking/skinning div cotents Hello All, First of all, as a new jQuery lister, I'd like to thank you all for such a great community project resulting in a fantastic js toolset. I love great community driven projects (they make me feel all warm and fuzzy inside :) ). Anyway, after a long search with no answer, I have question for you. Scenario: - Multiple portlets (jsr-168) on a page, each being a disparate application. - Most operating as ajax clients - Some possibly designed as semi-real-time/server synchronized applications (which means they have an internal clock which is kept in sync with the server so that the events of many clients are performed within a synchronous envelop, this is to account for network latencies and such). Hope that's clear enough. Furthermore, some operations in the UI may take considerable time to execute (sorts, filters, ajax calls, etc...). The Problem: - I need a solution to block/blur specific areas of the page, a whole portlet maybe, or maybe even a portion of a portlet, without blocking other applications or areas of the page. For example, if I had a div#divA which contains whatever dynamic content, maybe a form, maybe some clickables, sortables, etc.. but I want one of these time consuming operations to block/blur only this one div#divA using a translucent onion skin, when the event is executing and unblock/unblur on completion. It would be virtually the same as say the blockUI plugin, but for a specific div. Do you think this is doable? I've been trying for a couple of days, just with standard js/css and can't get it right in both FF and IE, it seems to be either/or... Note that the scrollable div in IE seems to often defeat the overlays I've tried, once the scroll bar appears... Ideas? Thanks, -- Raymond Auge [EMAIL PROTECTED] Software Engineer Liferay, Inc. Enterprise. Open Source. For Life. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Ce message Envoi est certifié sans virus connu. Analyse effectuée par AVG. Version: 7.5.441 / Base de données virus: 268.18.0/689 - Date: 15/02/2007 17:40 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Target iframe generated by jquery
On 14/02/07, 15daysofjquery [EMAIL PROTECTED] wrote: How do I target an element inside of an iframe I've created on the page? In other words, I've used jQuery to create an iframe, and now I need to target all the p elements of the document inside that iframe. I've tried $(p,self.MyIFrame.document).click(function(){alert('asdf');}); and also $(p,oIframe).click(function(){alert('asdf');}); where oIframe is var oIframe = document.getElementById(if); The frame generated by jquery is straightforward: $('div#results').empty().append('iframe src='+t+' frameborder=1 width=90% height=300px id=if name=MyIFrame/iframe'); Thanks. -- Have you included jQuery in the target frame? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Custome selectors use : as seperator, which is an official character for id's
On 15/02/07, Jason Levine [EMAIL PROTECTED] wrote: It looks like : isn't a valid character for ID attributes. From http://www.w3.org/TR/html401/types.html#type-name : ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens (-), underscores (_), colons (:), and periods (.). I've never used JSF, so I can't speak to how to solve this problem. Is there a way to specify the ID attribute, overriding the normal JSF : usage? -- It is valid (as it mentions colons in the text you quoted), just not at the start. However, when you do that, you cannot reference them by CSS (same thing applies to period (.)) ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Table striping, speed question
On 15/02/07, Brice Burgess [EMAIL PROTECTED] wrote: On 2/15/07, *Angelo Sozzi* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Just a minor (nice to know) question: When stripping multiple tables or lists on a single page $(.stripMe li:even).addClass('alt'); won't work as it itterates over all the li element regardless of the table they are in. So I went for: You can limit the scope to a particular table via; $('.stripMe li:even',document.getElementByID('table')).addClass('alt'); for instance. ~ Brice Why not just like this (which would probably be quicker as well). $(#myid.stripeme li:even).addClass(alt) With jQuery, you don't need to use getElementById or getElementsByTagName ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery Nightly Builds
On 14/02/07, John Resig [EMAIL PROTECTED] wrote: This is a re-post of a blog post written by Paul McLanahan: http://jquery.com/blog/2007/02/13/jquery-nightly-builds/ Hey Everyone - After much wailing and gnashing of teeth, we now have automated nightly builds of jQuery ready for mass consumption. These builds came about due to we community members who would like to experiment with the most recent features of jQuery, on our projects, but who for whatever reason, don't have access to the subversion repository. In any case, here are the gory details: You can get your bleeding-edge-jQuery fix at: http://jquery.com/src/nightlies/ This folder will simply show you a list of available files. There are 4 files in there in which most of you will be most interested. And they are... * http://jquery.com/src/nightlies/jquery-nightly.js Pretty self-explanatory. It's the uncompressed jQuery; fresh from the repository. * http://jquery.com/src/nightlies/jquery-nightly.pack.js As the more perceptive of you have already guessed, it's the packed version of #1 * http://jquery.com/src/nightlies/jquery-nightly.release.zip This contains the docs, test suite, and all of the pre-built versions of jQuery * http://jquery.com/src/nightlies/jquery-nightly.build.zip Is the real win for the poor souls behind the fiery-walls of the corporate world. It contains the full jquery path from the repo, and is everything you need to build your very own jQuery The nightlies folder will also fill up with dated versions of all 4 of these files so that you can find jQuery at whatever vintage you prefer. New versions of the nightlies will be added every day at 2am EST (7am GMT), and will consist of the most recent revision from the subversion repository at that time. If all of this talk of subversion, repositories, bleeding-edge, and nightly building makes the stability craving web developer inside you run away screaming, fear not. The stable release download you need is still right there, waiting for you. http://docs.jquery.com/Downloading_jQuery Any chance this could be done with the plugins? If not all, maybe just the popular ones (like dimensions). Whenever I download them I can't really be sure what revision I am using as downloading via the TracBrowser does not add this information (is it possible for it to?). CVSWeb allows checkout (e.g. http://www.example.org/cgi/cvsweb.cgi/~checkout~/CVSROOT/myfile), is TracBrowser not capable of that? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Any idea on how to replace select with div
On 14/02/07, Agrawal, Ritesh [EMAIL PROTECTED] wrote: Hi, I am wondering did anyone ever tried to create some alternative for selectoption list. I like using select-option as it provides the ability to use keystrokes to change selection. However, I can't change the font color or add new icons infront of the test. Hence, I was wondering to replace each line of text with div and write an javascript that implement keystroke behaviour...But I am not a javascript expert... Can some one give me an idea...here what I am planning to do Original select optionA/option optionB/option /select Modified div divA/div divB/div /div Motivation: to provide an ability to change color or even have icons along with text and retain the ability to modify select by keystroke. -- Perhaps something like this is what you are looking for: http://cbach.jquery.com/demos/selectbox/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Setting an image caption width
On 14/02/07, Seb Duggan [EMAIL PROTECTED] wrote: Not sure I agree on the title attribute not being suitable, but I see your point on the alt. Nevertheless, I want to change this: img src=/myimage.jpg width=250 height=350 alt=Alt text title=Some text I want to use as the caption class=captimg Into this: img src=/myimage.jpg width=250 height=350 alt=Alt text title=Some text I want to use as the caption class=captimg pSome text I want to use as the caption/p Nad have come up with a similar problem to before. This is what I have, and I know the $(this) doesn't work here, but I don't see how else to do it (and the 'after' method doesn't seem to take a function as an argument). $('.captimg').after('p' + $(this).attr('title') + '/p'); What do you reckon? Seb You will have to use each: $('.captimg').each( function() { $(this).after('p' + this.title + '/p'); }); On 13 Feb 2007, at 22:40, Klaus Hartl wrote: The alt attribute should be something different than the caption (and the title attribute as well by the way). Consider you were displaying a user image and the name of the user would be the caption in this case. img src=... alt=User: / John Doe If images are disabled, it would look like: User: John Doe In your case it would look like: John Doe John Doe which is not at all reasonable. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Select box manipulation plugins update
I have updated my plugins for working with select boxes. I am unable to test in Safari, but there should hopefully be no problems. Tested in IE 7, Firefox 2 and Opera 8.54. Available at http://www.texotela.co.uk/code/jquery/select/ Changes: addOption also replaces options with the same value (so that you don't get duplicates) selectOptions allow you to clear previously selected options (by supplying a boolean as the second parameter - setting to true clears, false leaves as is) Addition: copyOptions to copy options from one select to another. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Accordion trouble
On 13/02/07, Jon Ege Ronnenberg [EMAIL PROTECTED] wrote: Hi all. I've just found the Accordion plug-in and it seems pretty straight forward to implement but I get an $(:first-child, this)[0] has no properties in firebug when the page load and the navigation doesn't work. My code is really simple but maybe it could be thickbox or I'm just tired.. ... script type=text/javascript src=lib/jquery/jquery-compressed.js/script script type=text/javascript src=lib/ThickBox/ThickBox.js/script script type=text/javascript src=lib/Accordion/jquery.accordion.pack.js/script script type=text/javascript $('#ulClubs').Accordion({ header: 'a.club' }); ... ul id=ulClubs li a class=club href=#Club majo/a ul lia href=#DJs/a/li lia href=#Shows/a/li /ul /li li a class=club href=#En anden club/a ul lia href=#DJs/a/li lia href=#Shows/a/li /ul /li li a class=club href=#En anden club/a ul lia href=#DJs/a/li lia href=#Shows/a/li /ul /li /ul Do any of your guys (and girls) see any problems in this (except from the fact that it doesn't work)? Regards, Jon It looks like you are running the code before the page is ready. Try $( function() { $('#ulClubs').Accordion({ header: 'a.club' }); }); ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Select box manipulation plugins update
On 13/02/07, Sam Collett [EMAIL PROTECTED] wrote: I have updated my plugins for working with select boxes. I am unable to test in Safari, but there should hopefully be no problems. Tested in IE 7, Firefox 2 and Opera 8.54. Available at http://www.texotela.co.uk/code/jquery/select/ Changes: addOption also replaces options with the same value (so that you don't get duplicates) selectOptions allow you to clear previously selected options (by supplying a boolean as the second parameter - setting to true clears, false leaves as is) Addition: copyOptions to copy options from one select to another. Another addition. You can now add options via AJAX, with ajaxAddOption. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Miniscule (1k) Drag'n'Resize for jqModal via jqDnR
On 10/02/07, Brice Burgess [EMAIL PROTECTED] wrote: I have written a small Drag + Resize plugin to go along with jqModals minimalistic (lightweight) theme. It supports translucency, opacity preservation, handles, dragging, and south-east resizing. The jqDnR plugin page is @ http://dev.iceburg.net/jquery/jqDnR/ If you require more advanced resizing, jqModal can be coupled just as easily with iResizables from jQuery Interface Elements (http://interface.eyecon.ro/). I plan on adding minimal height/width constraints to jqDnR if it proves popular enough. The jqModal plugin page ( http://dev.iceburg.net/jquery/jqModal ) has been updated with an example demonstrating DnR on a notice (example 4b). We now have a versatile DnR+Modal Dialog combined plugin @ 3.6k. Enjoy! ~ Brice That's a pretty handy plugin (although at the moment, I have no use for drag/drop/resize). How about the ability to add constraints (i.e. only resize horizontally or vertically)? That could be useful if someone was doing a site that allowed the user to resize columns etc. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Help with a function
On 11/02/07, Mike Alsup [EMAIL PROTECTED] wrote: all...this is the completed thing...certainly, if people want to crit what I've done here that could be educational... Hi Vaska, This is a very active mailing list so sometimes things get missed. Good job working out your code. Some quick comments: 1.) Inside a plugin 'this' is the jQuery object so you don't need to wrap it in $(). 2.) Some things are easier - and faster - without jQuery, like getting simple element attrs. 3.) Don't forget the 'var' keyword when declaring variables. jQuery.fn.tabpost = function(callback) { this.click(function() { var check = this.title; // call back will go here eventually $('#' + this.parentNode.id + ' li').each(function() { $(this).compare(check, this.title); }); }); } Or even better (would work if the parent node did not have an id): jQuery.fn.tabpost = function(callback) { return this.click(function() { var check = this.title; // call back will go here eventually $(this).parent().find('li').compare(check, this.title); }); } ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] check for checked
On 12/02/07, Andreas Wahlin [EMAIL PROTECTED] wrote: I have a jquery selection of input tags of type checkbox, I want to filter out those that are checked. Feels like it should be something easy like $('[EMAIL PROTECTED]', checkboxes); andreas Even simpler than that. For all checked boxes on a page: $(input:checked) For those within a form (or div, fieldset etc) with an id myform: $(#myform input:checked) ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] check for checked
On 12/02/07, Mike Alsup [EMAIL PROTECTED] wrote: For all checked boxes on a page: $(input:checked) That will get you checked radios too. How about $([EMAIL PROTECTED]:checked) ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery Validation 1.0 Alpha
On 08/02/07, Jörn Zaefferer [EMAIL PROTECTED] wrote: Hi folks, there were some questions about my very first version of the validation plugin (it's still on the plugin page). If you are interested in form validation, you may want to take a look at the current state of the plugin: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ It's 1.0 version is now in alpha status: That means that I can't guarantee to not change the API until the beta release. But apart from that, the plugin is already pretty stable, and should provide nearly everything you need for client-side form validation. It uses the metadata plugin, therefore you can choose between specifiying your validition in the markup via extra class infos or custom attributes. Or, in case you don't want to use inline markup, you can just pass the rules as a JavaScript object to the plugin (see the examples). The plugin is aimed at both fast prototyping and highly customized validation: There are default messages for all provided methods (required, email etc.) that can be overriden by using the title attribute on input elements, specifying custom error messages in the markup (the old method with labels) or via a JavaScript object passed to the plugin. The plugin page contains some more information about known issues, migration from the old plugin and, in the extreme contrast to the old version, a nearly complete documentation. I'm sure there is room for imrovement, but at least it covers everything. Demos ( http://jquery.bassistance.de/validation/validateTest.html ) cover also integration with the form plugin: http://jquery.bassistance.de/validation/formPluginIntegration.html Your feedback is highly appreciated! We should be able to create the definite solution for jQuery form validation... Regards -- Jörn Zaefferer http://bassistance.de Looks like it is coming along nicely. One issue I can think of is if an element doesn't have an id (and it's not a checkbox or radio), it won't validate: input type=text name=FirstName / I think name should be used instead of id, especially since when you submit a form that is used to identify form elements (I think that is how it works - a simple test would be a form with differents ids on the elements with a server script to loop through them). ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jqModal updated -- dialog customization galore
On 07/02/07, Brice Burgess [EMAIL PROTECTED] wrote: I've updated jqModal to revision 5. Plugin page is @ http://dev.iceburg.net/jquery/jqModal/ Here's what has changed; --- + Added on open and on close callbacks for further control and flexibility. - A notice demonstration has been added to plugin page demonstrating a translucent dialog with display effects via callbacks. + Brought the README up to date (documentation) + IE Fixes; When overlay is disabled (set to 0), an iframe is drawn around the dialog window instead of whole page. This prevents ActiveX bleed AND allows page to remain interactive. + The 'ajax' URL can now be extracted from an attribute of the triggering element by prefixing with a '@'. For instance, {ajax: '@href' } would tell jqModal to extract the remote content URL from the triggering link's [a href=blah.html] HREF attribute. + Re-introduced the overlay class so that adding a background image to overlay tint is possible + Improved page height calculation -- overlays now behave on pages with little content --- I still need to come up w/ some mind blowing examples ;) But I hope that we're at least on our way. Enjoy! ~ Brice Looking good. Some suggestions though: - Preload the images used by the styled dialog - Maybe use Yahoo's Skinning method (http://developer.yahoo.com/yui/examples/container/skin/1.html - i.e. use the same class names and structure). That way, this could be a drop in replacement without developers needing to change their markup. - True Model sample doesn't allow you to use the tab key to move to the close button (it only tabs to Yes, No and the element that triggered the dialog). ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Taconite Plugin - New and Improved!
On 07/02/07, Felix Geisendörfer [EMAIL PROTECTED] wrote: I really like this! Now even so it says it's intended to be used for XHTML only, is there anything in the plugin code that would make it complicated to use Html 4 instead? I'm just not into serving browsers with xhtml tag soup if they are going to parse it as Html 4 anyway ; ). -- Felix Geisendörfer aka the_undefined -- http://www.thinkingphp.org http://www.fg-webdesign.de It is probably better to think of it as serving valid XML, rather than valid XHTML as I doubt it validates the markup. Also, I assume this plugin could be used to update an XML document (that is rendered client side using XSL)? I think it would struggle with tags that are self closing (as it wouldn't be valid XML). e.g. taconite append select=#status Your order has shipped! hr Please visit us again /append /taconite hr and hr / are both valid in HTML. Danial Tzadeh wrote: Wow! this thing is great!!! The idea is genius. Congratulations! On 2/6/07, Marshall Salinger [EMAIL PROTECTED] wrote: Beautiful work Mike. I can't wait to start testing and using this! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Alsup Sent: Tuesday, February 06, 2007 12:40 PM To: jQuery Discussion. Subject: [jQuery] Taconite Plugin - New and Improved! I've just rewritten my Taconite Plugin and added some pretty cool features. If you're not familiar with Taconite, it's an easy way to effect multiple client-side updates with the results of a single ajax call. With this latest version there is absolutely no code required to process command documents returned from the server. The plugin detects taconite responses and automatically processes them for you. Other changes: - Available commands now include almost everything in the jQuery API - Vastly improved logging/debug support - Fully extensible Full details and examples can be found at: http://www.malsup.com/jquery/taconite/ Mike PS: For anyone using my old xmlExec plugin, this is a drop-in replacement. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] .load() on IE7 returns Cached results
On 07/02/07, Michael E. Carluen [EMAIL PROTECTED] wrote: Thank you very much, Blair. That seems to have done the trick. Don't you wish sometimes IE would just go away so life would be simpler. ;-) Also did you try setting the headers server side, e.g. in PHP: ?php header(Cache-Control: no-cache, must-revalidate); // HTTP/1.1 header(Expires: Mon, 26 Jul 1997 05:00:00 GMT); // Date in the past ? To be honest, I think IE is actually doing the right thing (unless you actually did set the headers as above) as I don't think relying on meta tags in the html document is a good idea. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Blair Mitchelmore Sent: Tuesday, February 06, 2007 10:41 PM To: jQuery Discussion. Subject: Re: [jQuery] .load() on IE7 returns Cached results Try adding a random number or a timestamp to the url you request. IE loves to retrieve caches when you don't want it to. -blaie Michael E. Carluen wrote: Hello folks. I've been using load() to return some data. Works fine on Firefox. However, IE7 seems to load data that's been cached. The page being loaded already includes all the flavors of no-cache meta tags. Any suggestions? Thanks in advance. ___ 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/