[jQuery] (validation) jQuery validation plugin and FormWizard
Hi All! I have a really, really long form (about 300 fields) that I broke down into different sections using this slick a href=http:// www.jankoatwarpspeed.com/post/2009/09/28/webform-wizard-jquery.aspxjQuery plugin Form Wizard/a. If you group your form into different fieldsets, the FormWizard will automagically display one section at a time, with a Next hyperlink to take you to the next section with codea id=step0Next class=next href=#Next /a/code My question is this: Using the jQuery Validation plugin, how can I validate each fieldset when a user clicks Next, and so forth, instead of using the Submit button - how can I validate the form in steps rather than all at once? Put differently, how can I change the trigger event from Submit to six different hyperlinks for six separate sections? Thanks for helping this newb out.
[jQuery] Hide parent where a child contains....
I'm sure that I'm just missing something simple. Basically, I'm trying the hide the fieldset element if it contains legendPromotions/ legend but I can't get it to work. Here is my latest jQuery(fieldset:has('legend':contains:('Promotions'))').hide(); I've tried several variations of this, including trying to hook onto the parent element and such, but I just can't get anything to work. I'll supply what my HTML code looks like below. Any help would be appreciated. h1Categories/h1 fieldset legendCuisines/legend input type=checkbox name=OnsaleCouponsCategory[] value=48 / input type=checkbox name=OnsaleCouponsCategory[] value=49 / input type=checkbox name=OnsaleCouponsCategory[] value=50 / /fieldset fieldset legendAtmosphere/legend input type=checkbox name=OnsaleCouponsCategory[] value=62 / input type=checkbox name=OnsaleCouponsCategory[] value=63 / /fieldset fieldset legendPromotions/legend input type=checkbox name=OnsaleCouponsCategory[] value=91 / input type=checkbox name=OnsaleCouponsCategory[] value=92 / input type=checkbox name=OnsaleCouponsCategory[] value=93 / input type=checkbox name=OnsaleCouponsCategory[] value=94 / input type=checkbox name=OnsaleCouponsCategory[] value=95 / input type=checkbox name=OnsaleCouponsCategory[] value=96 / /fieldset
[jQuery] Newbie Question: get id from A tag
Hello, I am not good at js. I want to get the id from A tag. E.g. a href=/comment.php class=clickme id=1234link/a I need the value 1234 from the code above, but dont know how to do it. Please help. Thanks.
[jQuery] Re: Newbie Question: get id from A tag
ok, got it. thanx weidc, On Mar 24, 9:44 pm, weidc mueller.juli...@googlemail.com wrote: $(.clickme).attr(id); On 24 Mrz., 14:03, Jesse cdrp...@gmail.com wrote: Hello, I am not good at js. I want to get the id from A tag. E.g. a href=/comment.php class=clickme id=1234link/a I need the value 1234 from the code above, but dont know how to do it. Please help. Thanks.
[jQuery] Confused by adding confirmation plugin to Rails ajax link
The plugin page, http://nadiana.com/jquery-confirm-plugin The span class of remove is a gray box that turns red on hover. It functions as a link to an ajax delete method. I want to mouseover the box and bring up the Yes/No confirmation buttons. Have been at it for a couple hours now. Help greatly appreciated. Thank you. %= link_to_remote span class=\remove\/span, :url = { :controller = :actions, :action = :remove, :id = action }, :html = { :onmouseover = ??? } % At this point, any of the available methods will suffice, to get the juice flowing.
[jQuery] Re: abort an animation?
You can call .stop() to stop an animation, and .css('opacity', 1) to remove transparency. Cheers, Jesse Skinner www.thefutureoftheweb.com On Sat, Jan 17, 2009 at 11:13 AM, Stephan Veigl stephan.ve...@gmail.comwrote: How can I abort an animation? I have a slow fadeOut() on an element. Under some conditions I would like to stop the fadeout and show the element without any transparency. How can I do this? Stephan
[jQuery] Re: Can I override ui.draggable?
You can attach data to each draggable HTML element (eg. a big div or table) using the .data() jQuery function. Then when an element is dropped, you can use .data() again to retrieve the object attached to it and use that data for processing/saving/etc. I hope that helps. Cheers, Jesse Skinner www.thefutureoftheweb.com On Fri, Jan 16, 2009 at 11:13 PM, alphadog alphad...@gmail.com wrote: So, if I understand correctly, when I create a droppable, and it gets triggered by a draggable, the drop callback gets access to the draggable via ui.draggable. ui.draggable seem to wrap up the child tags of whatever tag got labeled as a draggable. This works well if you are dragging one tag, not so well if you want to drag complex data represented by a big div or table. Is there a way to somehow override ui.draggable? Ideally, I'd like the drop to see a JSON object instead of a messy pile of HTML.
[jQuery] Re: jQuery UI tabs widget problem
I would like to confirm that the array methods for disabling tabs does not work. I have 1.6rc4 installed. 5 Tabs 4 of which I need disabled on page load jQuery('#product').tabs(); jQuery('#product').tabs(disabled.tabs, [1,2,3,4]); does not work.. neither does jQuery('#product').tabs({ disabled: [1,2,3,4] }); However this does work jQuery('#product').tabs(); jQuery('#product').tabs(disable, 1); jQuery('#product').tabs(disable, 2); jQuery('#product').tabs(disable, 3); jQuery('#product').tabs(disable, 4); J On Jan 10, 4:25 am, Klaus Hartl klaus.ha...@googlemail.com wrote: $(#tabs).data('disabled.tabs', [1,2]) as well as $(#tabs).tabs ({ disabled: [1,2] }) both do work fine for me. --Klaus On 9 Jan., 12:47, tesdev tesde...@googlemail.com wrote: Using jquery.ui-1.6rc4\jquery.ui-1.6rc4\demos\tabs\default.html as a base Getting there... ui-state-disabled is assigned but... line 11 ... $(function() { $(#tabs).tabs(); // tried 3disablevariations from different sources //$(#tabs).data('disabled.tabs', [1,2]); $(#tabs).tabs(disable, 1); //works $(#tabs).tabs(disable, 2); //works //$(#tabs).tabs({disabled: [1,2]}); }); The array versions dont work - should they in this context? Danny On Dec 31 2008, 5:26 pm, Klaus Hartl klaus.ha...@googlemail.com wrote: No suggestions unless you show us some code... --Klaus On 31 Dez., 08:11, JasonR jbra...@yahoo.com wrote: Hello, I have some content and am using thetabswidget to reload without refreshing. Everything is working fine except for one problem...the ui- tabs-disabled class is not being assigned to any of thetabs. Whichever tab I click is assigned the ui-tabs-selected class, and the tab adopts the styles for that class. But my styles for the disabled tabsare not showing up. Checking in Firebug I can verify that the class is not being assigned. Any suggestions? Thanks.
[jQuery] textarea problem
I have an html textarea that is 41 columns wide. I need to capture each line and input it into a database( each line in its own seperate field). I have been searching the internet and haven't had any luck at finding anything. Any help would be greatly appreciated. Thanks!
[jQuery] jQuery Tooltip plugin speech bubbles over image map
I am attempting to adapt the tooltip plugin to work with an image map, but I can only get 'standard' pop ups to function over map objects. Has anyone been able to make the tooltip plugin work with an image map and speech bubbles (fancy decorated popups)? Ideally I would like to get this working, and possibly with a :hover for the map areas for highlighting.
[jQuery] How do I get a standard DOM object from jQuery selector.
I have a feeling I'm just missing something in the documentation, but is there anyway to get a standard DOM object to return from a jquery selector? div id=context div class=target/div /div Essentially I want a way for $('.target', '#context') to give me the equivalent of document.getElementById('context').getElementsByTagName('div')[0]
[jQuery] Standard DOM returned from jQuery selector
I have a feeling I'm just missing something in the documentation, but is there anyway to get a standard DOM object to return from a jquery selector? div id=context div class=target/div /div Essentially I want a way for $('.target', '#context') to give me the equivalent of document.getElementById('context').getElementsByTagName('div')[0]
[jQuery] jscroll not scrolling full page
On load my content gets cut off. But not all the time. This problem is somewhat consistent in Safari on a Mac and intermittent in FF. if you jump back and forth between the following two pages it will break. examples: http://zanaganda.com/JA2/atelier/methodology.htm http://zanaganda.com/JA2/atelier/workshops.htm I just updated and wasn't having this problem before. Any thoughts? Thanks!
[jQuery] Re: On page load the height calculation in jScrollPane
I am having exactly the same problem. did you find a solution to this? On Feb 29, 4:55 am, amar [EMAIL PROTECTED] wrote: I havejScrollpaneused in my application. I have normal html page with static content and two images. In the first time when the page loads, it is displaying half of the page content with the cut image in the down in scrollbar area. But if i refresh the page or reloads the page, It is displaying with the full content. Please tell me what may be the problem here.. This is the URL where i am getting the problem. (http://59.144.40.60/ ipathshala/Modules/Public/goldentemple.html) Thanks in Advance
[jQuery] Re: jscroll not scrolling full page
applying size attributes to each image seems to have done the trick. On Mar 24, 6:26 pm, jesse z [EMAIL PROTECTED] wrote: On load my content gets cut off. But not all the time. This problem is somewhat consistent in Safari on a Mac and intermittent in FF. if you jump back and forth between the following two pages it will break. examples:http://zanaganda.com/JA2/atelier/methodology.htmhttp://zanaganda.com/JA2/atelier/workshops.htm I just updated and wasn't having this problem before. Any thoughts? Thanks!
[jQuery] JScrollPane external css linkage quirk
Linking an external layout css to my page seems to break jscrollpane intermittently in Safari only. All other browsers seem to handle the linkage fine. It happens most often when using the back button but also when going from page to page. When i leave the style in my header everything functions fine. I have left the holder class in the header as it was on the jscrollpane sample html. Examples: functioning: http://zanaganda.com/JA2/atelier/workingscroll.html jscrollpane not functioning when linking external css contentpage2.css: http://zanaganda.com/JA2/atelier/workingscroll2.html Any thoughts on this really appreciated. BTW Kelvin, despite my struggles with this, I am really happy with your plugin, its exactly what i was looking for.
[jQuery] Re: jscroll not recognizing mouse up outside of the scroll pane
That did it. Thanks! On Mar 23, 6:03 am, Kelvin Luck [EMAIL PROTECTED] wrote: Hi, It looks like you are using a fairly old version of jScrollPane. Grab the latest from here: http://kelvinluck.com/assets/jquery/jScrollPane/jScrollPane.html Let me know if you experience the problem with the latest version - I think it's something I fixed a while back... Cheers, Kelvin :) jesse z wrote: I am curious if anyone has come across or resolved this yet. When my user drags the scroll bar on mouse down and continues to hold their mouse down as they drag outside the scrollpane, and then release their mouse, jscroll doesn't recognize the mouse up outside of the pane window. The result is that when they come back to the scrollpane it still thinks that their mouse is in the down position. example here. http://zanaganda.com/JA2/books2_content.html any thoughts on this would be really appreciated, -jesse
[jQuery] Re: jscroll not recognizing mouse up outside of the scroll pane
While I have you here Kevin, the scroller is still very jumpy on FF on a Mac with this new version. Is there a fix for this? On Mar 23, 6:03 am, Kelvin Luck [EMAIL PROTECTED] wrote: Hi, It looks like you are using a fairly old version of jScrollPane. Grab the latest from here: http://kelvinluck.com/assets/jquery/jScrollPane/jScrollPane.html Let me know if you experience the problem with the latest version - I think it's something I fixed a while back... Cheers, Kelvin :) jesse z wrote: I am curious if anyone has come across or resolved this yet. When my user drags the scroll bar on mouse down and continues to hold their mouse down as they drag outside the scrollpane, and then release their mouse, jscroll doesn't recognize the mouse up outside of the pane window. The result is that when they come back to the scrollpane it still thinks that their mouse is in the down position. example here. http://zanaganda.com/JA2/books2_content.html any thoughts on this would be really appreciated, -jesse
[jQuery] Re: simple Jquery Ajax XHR async request for XML and JSON please
I am looking for some basic examples showing how to do simple XHR's with both XML and JSON datatypes. How do you parse the XML vars using Jquery? I am looking for simple examples that I can learn from. Just use the $.ajax function, and set the dataType option like this: $.ajax({ url: 'ajax.php', dataType: 'xml', success: function(xml) { // do something with XML document with DOM functions var items = xml.getElementsByTagName('item'); } } You can see the documentation of the $.ajax function here: http://docs.jquery.com/Ajax/jQuery.ajax#options Jesse www.thefutureoftheweb.com
[jQuery] Re: Superfish 1.4.1 update released
I am still struggling to find the time to work on those bugs. Anyone who has ideas about this, please feel free to contact me/Joel via this list. Joel, I appreciate your work, sorry I hadn't answered yet! -Original Message- About the callbacks. Would they enable us to write for instance this code outside of superfish ? http://www.klaasse.net/superfish-ext/superfish.html Yes. This is precisely the reason for the new callbacks. In fact I rewrote Jesse Klaasse's code to use the callbacks and the demo page can be found here: http://users.tpg.com.au/j_birch/plugins/superfish/supposition-test/menuA tTop.html I gave it the plugin of the plugin the name Supposition which is the crapiest name ever. Anyway, there are still issues with that code because when the document is longer than the window depth the scrolling is not taken into account when positioning the submenus which is disappointing. I don't know if this is a jQuery bug or a problem with the Supposition (hate that name so much) code as I am a n00b when it comes to dimensions code. I flicked my work back to Jesse to look at and also posted it to this group. Here's the thread: http://groups.google.com/group/jquery-en/browse_thread/thread/c4a290fc6a 2f6bfd
[jQuery] Re: Error when I try to interact with a Java Applet
I can confirm this.. I have the same problem with another applet..
[jQuery] Re: Superfish feature request
You're right, this is the quirk I'm talking about. I'm on Windows myself, so I have been referring to Windows Firefox. I'm still puzzled by this :| I hope we (or someone else) will be able to work this out.
[jQuery] Re: Superfish feature request
And a little update, as it seems to work great now (tested in IE6, IE7 and FF2): http://www.klaasse.net/superfish-ext/superfish.html I'm not totally satisfied yet, because: - I'm using + 1 in my calculations to include border/margin/padding stuff in the width() and height() results; - There's some strange right-border redrawing going on, which I can't explain; - As you may have noticed, there appear little arrows when a menu has a submenu. However, they disappear when one 'mouseover's the menuitem. Any suggestions / opinions / whatever? Maybe Joel can include something like this in the next release of Superfish. Feel free to use it! From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jesse Klaasse Sent: Wednesday, January 02, 2008 4:25 PM To: jquery-en@googlegroups.com Subject: [jQuery] Superfish feature request Importance: Low I am thoroughly enjoying the Superfish menu.. However, I would love to see the following option: when a submenu falls outside of the window, it's position should be adapted in order to fit. Just like most operating systems handle menus when they don't fit.. Would this be possible? It could be called something like 'forceFit' or so.. Thanks in advance! (The simplest approach would probably be to check if a ul's offset left plus it's width exceeds the window width, and adjust x position accordingly.. Likewise, this could be done for the vertical position)
[jQuery] Superfish feature request
For the demo of the latest update/example: http://www.klaasse.net/superfish-ext/superfish.html New options: * autofit (boolean) - Used to enable intelligent expansion. When a submenu doesn't fit on screen, the position of the menu is adapted in order to make it fit as good as possible. * expandClass (string) - Can be used to show submenu indicators using normal CSS. Known issues (tested in Safari 3, Opera 9, IE6, IE7 and FF2): * I'm using + 1 in my calculations to include border/margin/padding stuff in the width() and height() results. I would like to find a more robust solution; * There's some strange submenu text pixel-shift (FF only) and right border redrawing (both IE and FF) going on, which I can't explain. However, this also seems to happen using the original Superfish menu! * IE6 seems to handle the variable width top level (width:auto) incorrectly. A solution, anyone? If anyone can think of a solution to any of these issues, please let me know!
[jQuery] Re: Superfish feature request - pixelshift/redraw bug
This issue has something to do with the animation. When I replace the animation with a simple show() method, there's no pixel shift anymore.. * There's some strange submenu text pixel-shift (FF only) and right border redrawing (both IE and FF) going on, which I can't explain. However, this also seems to happen using the original Superfish menu! Maybe this is a common jQuery animation related bug? I have already tried the beta of 1.2.2, but unfortunately that didn't help..
[jQuery] Superfish feature request
I am thoroughly enjoying the Superfish menu.. However, I would love to see the following option: when a submenu falls outside of the window, it's position should be adapted in order to fit. Just like most operating systems handle menus when they don't fit.. Would this be possible? It could be called something like 'forceFit' or so.. Thanks in advance! (The simplest approach would probably be to check if a ul's offset left plus it's width exceeds the window width, and adjust x position accordingly.. Likewise, this could be done for the vertical position)
[jQuery] Re: Superfish feature request
I have written some test code, which does what it's meant to do, but I think it isn't in the right place.. I have added this code to the default options block of superfish.js: autofitX: true, autofitY: true, And this code instead of the original showSuperfishUl part: showSuperfishUl : function(o){ return this .addClass(o.hoverClass) .find('ul:hidden') .css('visibility','visible') .animate(o.animation,o.speed,function(){ o.onshow.call(this); if (o.autofitY) { var menuHeight = $ul.height(); var expandUp = ($ul.offset().top + menuHeight $(window).height()); if (expandUp) $ul.css(margin-top,($(window).height() - menuHeight - $ul.offset().top) + px); } }) .each(function(){ $ul = $(this); if (o.autofitX) { var menuWidth = $ul.width(); var parentWidth = $ul.parents('ul').width(); var expandLeft = ($ul.offset().left + menuWidth $(window).width()); if (expandLeft) $ul.css(margin-left,- + (menuWidth + parentWidth) + px); } }) .end(); }, This works, however, I don't think it's the correct place to perform these actions. Any opinions? From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jesse Klaasse Sent: Wednesday, January 02, 2008 4:25 PM To: jquery-en@googlegroups.com Subject: [jQuery] Superfish feature request Importance: Low I am thoroughly enjoying the Superfish menu.. However, I would love to see the following option: when a submenu falls outside of the window, it's position should be adapted in order to fit. Just like most operating systems handle menus when they don't fit.. Would this be possible? It could be called something like 'forceFit' or so.. Thanks in advance! (The simplest approach would probably be to check if a ul's offset left plus it's width exceeds the window width, and adjust x position accordingly.. Likewise, this could be done for the vertical position)
[jQuery] Ajax Working in Firefox 2.0.0.11 but not in IE6 or IE7
I am working on building a shopping cart and wanted to utilize jQuery's ajax methods to enhance some response times. If you go to http://www.blueskyvineyard.com/dry-wine and add an item to the cart, then either click the + or - to increase or decrease the quantity, it works just as expected in Firefox. However, in either flavor of IE, it will only increment or decrement once, and then will stop functioning. Here is my current code: jQuery(document).ready(function(){ jQuery(#highlight).animate({ backgroundColor: #b1f3b1 }, 500 ); jQuery(#highlight).animate({ backgroundColor: white }, 500 ); jQuery(#highlight).animate({ backgroundColor: #b1f3b1 }, 500 ); jQuery(#highlight).animate({ backgroundColor: white }, 500 ); jQuery('#clearCart').click(function() { jQuery.get(/, { clearCart: 1} ); jQuery(#minicart).html(h1Your Cart/h1pYour cart is empty./ p); return false; }); jQuery(#clearCart).confirm({ msg:'Are you Sure? ' }); jQuery(.ajax-container).each(function (i) { var target = this; var $target = jQuery(target); var id = jQuery(this).attr(id); jQuery(#remove + id).click(function () { jQuery(#ajaxwrapper+id).text(); jQuery.getJSON(/ajax-cart, { clearItem: id}, function(json){ if (json.e == 0) { jQuery(#totalitems).text(json.t); jQuery(#subtotal).text(json.s); jQuery(#discounttotal).text(json.d); } else { jQuery(#minicart).html(h1Your Cart/h1pYour cart is empty./p); } }); return false; }); jQuery(#inc + id).click(function () { var quantity = $target.text(); var incvalue = parseInt(quantity) + 1; $target.text(incvalue); jQuery.getJSON(/ajax-cart, { increment: id}, function(json){ jQuery(#totalitems).text(json.t); jQuery(#subtotal).text(json.s); jQuery(#discounttotal).text(json.d); }); return false; }); jQuery(#dec + id).click(function () { var quantity = $target.text(); var decvalue = parseInt(quantity) - 1; $target.text(decvalue); if (decvalue == 0) { jQuery(#ajaxwrapper+id).text(); } jQuery.getJSON(/ajax-cart, { decrement: id}, function(json){ if (json.e == 0) { jQuery(#totalitems).text(json.t); jQuery(#subtotal).text(json.s); jQuery(#discounttotal).text(json.d); } else { jQuery(#minicart).html(h1Your Cart/h1pYour cart is empty./p); } }); return false; }); }); jQuery(.ajax).attr({ href: # }); }); Any ideas? Also any tips on making my code less redundant would be helpful as I am kind of new at this.
[jQuery] Re: Ajax Working in Firefox 2.0.0.11 but not in IE6 or IE7
Yeah, this is exactly what the problem was. I managed to type in the right search string finally and found the answer in here. I actually decided to use $.post for my json request and IE does not cache POSTs. On Dec 18, 6:35 am, Andy K [EMAIL PROTECTED] wrote: On Dec 18, 10:22 am, Jesse R. [EMAIL PROTECTED] wrote: I am working on building a shopping cart and wanted to utilize jQuery's ajax methods to enhance some response times. If you go tohttp://www.blueskyvineyard.com/dry-wineandadd an item to the cart, then either click the + or - to increase or decrease the quantity, it works just as expected in Firefox. However, in either flavor of IE, it will only increment or decrement once, and then will stop functioning. Here is my current code: jQuery(document).ready(function(){ jQuery(#highlight).animate({ backgroundColor: #b1f3b1 }, 500 ); jQuery(#highlight).animate({ backgroundColor: white }, 500 ); jQuery(#highlight).animate({ backgroundColor: #b1f3b1 }, 500 ); jQuery(#highlight).animate({ backgroundColor: white }, 500 ); jQuery('#clearCart').click(function() { jQuery.get(/, { clearCart: 1} ); jQuery(#minicart).html(h1Your Cart/h1pYour cart is empty./ p); return false; }); jQuery(#clearCart).confirm({ msg:'Are you Sure? ' }); jQuery(.ajax-container).each(function (i) { var target = this; var $target = jQuery(target); var id = jQuery(this).attr(id); jQuery(#remove + id).click(function () { jQuery(#ajaxwrapper+id).text(); jQuery.getJSON(/ajax-cart, { clearItem: id}, function(json){ if (json.e == 0) { jQuery(#totalitems).text(json.t); jQuery(#subtotal).text(json.s); jQuery(#discounttotal).text(json.d); } else { jQuery(#minicart).html(h1Your Cart/h1pYour cart is empty./p); } }); return false; }); jQuery(#inc + id).click(function () { var quantity = $target.text(); var incvalue = parseInt(quantity) + 1; $target.text(incvalue); jQuery.getJSON(/ajax-cart, { increment: id}, function(json){ jQuery(#totalitems).text(json.t); jQuery(#subtotal).text(json.s); jQuery(#discounttotal).text(json.d); }); return false; }); jQuery(#dec + id).click(function () { var quantity = $target.text(); var decvalue = parseInt(quantity) - 1; $target.text(decvalue); if (decvalue == 0) { jQuery(#ajaxwrapper+id).text(); } jQuery.getJSON(/ajax-cart, { decrement: id}, function(json){ if (json.e == 0) { jQuery(#totalitems).text(json.t); jQuery(#subtotal).text(json.s); jQuery(#discounttotal).text(json.d); } else { jQuery(#minicart).html(h1Your Cart/h1pYour cart is empty./p); } }); return false; }); }); jQuery(.ajax).attr({ href: # }); }); Any ideas? Also any tips on making my code less redundant would be helpful as I am kind of new at this. This is due to the IE implementation of XMLHTTP being a little over- enthusiastic about using cached copies instead of going back to the server for each request. There are two ways of improving this, I prefer to use both ways at the same time just to be sure. The first way is to add a parameter to your AJAX get request that changes every time, I usually use nt: (new Date.getTime()), which can be ignored by the server code. The second way is for the server script to return a bunch of headers telling IE and any proxy servers to go back to the server every time. This is described athttp
[jQuery] Updating input values before the submit.
I have the following html code: form id=googleCheckout action=https://sandbox.google.com/checkout/ cws/v2/Merchant/747474/checkout method=post input type=hidden name=cart value=somevalue / input type=hidden name=signature value=anothervalue / input type=image name=Google Checkout alt=Fast checkout through Google src=https://sandbox.google.com/checkout/buttons/checkout.gif? merchant_id=747474amp;w=160amp;h=43amp;style=WHITEamp;variant=TEXTamp;loc=en_US height=43 width=160 / /form I want to dynamically load those values with a json request immediately before the submit, but not any sooner. I tried doing the following code: jQuery(#googleCheckout).submit(function() { jQuery.ajax({ type: POST, dataType: json, url: /json-checkout, error: function(){return false;}, success: function(json){ jQuery(input:first).attr({ value: json.gec }); jQuery(input:eq(1)).attr({ value: json.ges }); return true; } }); }); However, the ajax request fails according to Firebug and the submit contains the old data. The requested URL is http://www.blueskyvineyard.com/json-checkout. Any suggestions would be greatly appreciated!
[jQuery] Re: Updating input values before the submit.
The request is still failing. Any other ideas? On Dec 18, 11:37 am, Jake McGraw [EMAIL PROTECTED] wrote: The problem is that the form is actually submitting before you can get a response, this is the nature of an asynchronous request (the first A in AJAX). Perhaps you could bind the the submit to one of the callbacks: jQuery(#googleCheckout).submit(function() { var $form = jQuery(this); if (!$form.is(.okgo)) { jQuery.ajax({ type: POST, dataType: json, url: /json-checkout, error: function(){ // Do nothing, okgo not added }, success: function(json){ jQuery(input:first).val(json.gec); jQuery(input:eq(1)).val(json.ges); // This will prevent the AJAX message from being sent again $form.addClass(okgo); // Successful AJAX message, re-submit, this time for real $form.submit(); } }); return false; } }); On Dec 18, 2007 11:27 AM, Jesse R. [EMAIL PROTECTED] wrote: I have the following html code: form id=googleCheckout action=https://sandbox.google.com/checkout/ cws/v2/Merchant/747474/checkout method=post input type=hidden name=cart value=somevalue / input type=hidden name=signature value=anothervalue / input type=image name=Google Checkout alt=Fast checkout through Google src=https://sandbox.google.com/checkout/buttons/checkout.gif? merchant_id=747474amp;w=160amp;h=43amp;style=WHITEamp;variant=TEXTamp;loc=en_US height=43 width=160 / /form I want to dynamically load those values with a json request immediately before the submit, but not any sooner. I tried doing the following code: jQuery(#googleCheckout).submit(function() { jQuery.ajax({ type: POST, dataType: json, url: /json-checkout, error: function(){return false;}, success: function(json){ jQuery(input:first).attr({ value: json.gec }); jQuery(input:eq(1)).attr({ value: json.ges }); return true; } }); }); However, the ajax request fails according to Firebug and the submit contains the old data. The requested URL is http://www.blueskyvineyard.com/json-checkout. Any suggestions would be greatly appreciated!
[jQuery] Re: Performance of jquery
These are my (total) results: IE7 Prototype: 2199 ms Mootools: 1546 ms jQuery: 1336 ms FF2 Prototype: 326 ms Mootools: 390 ms jQuery: 1092 ms SAFARI3 Prototype: 896 ms Mootools: 279 ms jQuery: 452 ms So, there seem to be big differences between IE, Safari and FF, both in overall DOM/Javascript speed (FF seems to be a LOT faster) and in the different libraries. In IE jQuery is the big winner, in FF the big loser. Regards, Jesse Klaasse. -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Tuesday, December 11, 2007 3:22 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Performance of jquery Importance: Low maybe it depends on your browser and/or pc, it seems fastest when I run the test... -ark - Original Message - From: Sharique [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Tuesday, December 11, 2007 9:10 AM Subject: [jQuery] Performance of jquery | | Pls have a look at this test. | http://mootools.net/slickspeed/ | Performance of JQuery of quite low as compare to other java script | libraries. | -- | Sharique
[jQuery] Is it possible to alter internal CSS properties?
As we all know, we can do the following using jQuery: $('.someClass').css(background-color: yellow); This first matches all elements which have the class someClass, and then alters the css of the matched elements. This won't work when the class is dynamically added somewhere in the page, for example on a mouseover. Is it somehow possible to really alter the internal style sheet definition, in order to reflect the wanted changes when a class is dynamically added? My guess is that this is not possible at all, but I'm not sure.. Any ideas? Thanks!
[jQuery] Is it possible: Superfish over Java applet?
I have created the following testpage (using the Superfish example page): http://www.bam.nl/baminternet/baminternet/test/test_SuperfishApplet.html As you can see, the Superfish menu disappears behind the Java applet. Would it be possible to correct this behaviour to display the menu on top of the Java applet? The common z-index fixes don't seem to be working :( -- View this message in context: http://www.nabble.com/Is-it-possible%3A-Superfish-over-Java-applet--tf4676372s27240.html#a13360849 Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] jQuery AJAX load and encoding/charset problems
I have already spent hours and hours on the following problem. I am using jQuery's AJAX load method in order to put a portlet in a DIV. The portlet url is: http://www.bam.nl/baminternet/baminternet/test/test_jQueryAjax/actueel.jsp http://www.bam.nl/baminternet/baminternet/test/test_jQueryAjax/actueel.jsp Which is showing fine when called directly. However, when using AJAX to load the portlet into a DIV, this is the result: http://www.bam.nl/baminternet/baminternet/test/test_jQueryAjax/ajax_encoding_test.jsp http://www.bam.nl/baminternet/baminternet/test/test_jQueryAjax/ajax_encoding_test.jsp As you probably can see, there seems to be some encoding/charset problem here. We are using the ISO-8859-1 charset all over the website, except for the news portlet, which uses ISO-8859-15 in order to support special Word-characters like euro signs, long dashes and so forth. I have tried to remove and put charset specifications everywhere, but nothing seems to help. Does anyone have a suggestion how to fix this? Thank you all very much in advance! Kind regards, Jesse Klaasse -- View this message in context: http://www.nabble.com/jQuery-AJAX-load-and-encoding-charset-problems-tf4669662s27240.html#a13339398 Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] $(document).ready inconsistent behaviour IE/FF - bug?
Schematically I have the following page: html head script type=text/javascript $(document).ready(function() { alert(DOM ready); }); /script /head body table tr tdMenu/td tdiframe src=content.jsp/td /tr /table /body /html content.jsp sleeps for 10 seconds, then outputs a simple page. In IE (7), the alert shows when we have waited the 10 seconds from content.jsp. In other words, the DOM is ready when the DOM for the iframe is also ready. In FF (2), the alert is fired when the page itself is loaded. It doesn't wait the 10 seconds for content.jsp. Can anyone confirm this behaviour? This seems like a bug to me. For now, the only solution for me is to include the script part inline at the end of the page, after the iframe. Regards, Jesse.
[jQuery] document.ready inconsistent behaviour IE/FF - bug?
(I have already sent this message but somehow it got marked as spam??!) Schematically I have the following page: html head script type=text/javascript $(document).ready(function() { alert(DOM ready); }); /script /head body table tr tdMenu/td tdiframe src=content.jsp/td /tr /table /body /html content.jsp sleeps for 10 seconds, then outputs a simple page. In IE (7), the alert shows when we have waited the 10 seconds from content.jsp. In other words, the DOM is ready when the DOM for the iframe is also ready. In FF (2), the alert is fired when the page itself is loaded. It doesn't wait the 10 seconds for content.jsp. Can anyone confirm this behaviour? This seems like a bug to me. For now, the only solution for me is to include the script part inline at the end of the page, after the iframe. Regards, Jesse. -- View this message in context: http://www.nabble.com/document.ready-inconsistent-behaviour-IE-FF--%3E-bug--tf4670353s27240.html#a13341722 Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: jQuery AJAX load and encoding/charset problems
Dan, I have removed the HTML and body tags now, but unfortunately this doesn't seem to help. Any other ideas? -Original Message- One thing I noticed quickly is this page is a full HTML that includes html and body tags. If you're loading HTML fragments into a DIV, you shouldn't load a fully qualified HTML page--you should only load the content that would be between the body tags. Having multiple html and body tags can sometimes do all sorts of strange things. -Dan
[jQuery] Re: tablefilter preview
Great efforts so far! I think I will be using your plugin when it's ready.. For now, just one comment: the plugin doesn't work in IE7, I get a javascript error Object doesn't support this action. Please keep us posted! LetsSurf wrote: I've been writing a tablefilter plugin to sit along side tablesorter from Christian Bach. It will supply multi column filtering. Have support for different filter types, e.g. text (case sensitive/ insensitive), numeric, regex + any more people might add. [...] I'm releasing a preview, to get some feedback on the UI. -- View this message in context: http://www.nabble.com/tablefilter-preview-tf4521631s27240.html#a12976215 Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] select value lost after clone in IE
It seems that after a jQuery clone(), the value of select boxes are lost in IE (but not Firefox). Try this out: div select option value=0one/option option value=1 selected='selected'two/option /select /div $(function(){ $('div').clone(true).appendTo('body'); }); The first option will be selected in the cloned select. Doing something like this fixes the problem (as long as there is only one select box), though I suspect there needs to be a better fix in jQuery explicitly: $(function(){ var old = $('div'); var clone = old.clone(true); var select_val = $('select', old).val(); $('select', clone).val(select_val); clone.appendTo('body'); }); Cheers, Jesse www.thefutureoftheweb.com
[jQuery] Re: XML Problems
I'm having problems using jQuery to manipulate XML documents (response from Ajax queries). I wonder if anyone can tell me what the problem is or where I'm going wrong. I've setup a page with tests here: http://www.fyneworks.com/jquery/jQuery-XML-Problems/ For Test #3, your result area ID is wrong - you have 2 Result2 divs and no Result3 div. For Test #5, you are trying to do this: n = $('test', $('divemPassed!/em/div')); which, of course, doesn't return any elements - there is no 'test' tag in the string you passed. Perhaps you meant to do this: n = $('test', $('divtestPassed!/test/div')); I hope that helps. Cheers, Jesse Skinner http://www.thefutureoftheweb.com/
[jQuery] Re: Multiple .bind
I've just submitted a patch to fix this, but in the meantime you can use an anonymous function (as I just described in another message) like so: function tocDisplay(e){ $('#toc_content')[e.data.mode](); } $('#toc_header').bind('click', {mode: 'toggle'}, function(e){ tocDisplay(e); }); $('#toc_content a').bind('click', {mode: 'hide'}, function(e){ tocDisplay(e); }); -- Jesse Skinner http://www.thefutureoftheweb.com DaveG wrote: I'm binding a click function. If I include either one of the binds it works -- so the syntax and object references are correct. If I include both binds they do not work. No errors, they just don't trigger. function tocDisplay(e){ $('#toc_content')[e.data.mode](); } $('#toc_header').bind('click', {mode: 'toggle'}, tocDisplay); $('#toc_content a').bind('click', {mode: 'hide'}, tocDisplay); Is there a problem binding the same function to multiple objects? ~ ~ Dave
[jQuery] Re: Building HTML and binding to an inner element.
I just submitted a patch for this bug. As a temporary workaround, you could fix this by using an anonymous function wrapper, like so: el.bind('click', data, function() { return my_func.apply(this, arguments); }); or in the context of your example: $( li style=\display: none\+ [+task.client.code+] +task.project.name+ br/+task.name+br/+ a class='removeTask' href='#'Remove/a+ /li ).find(a.removeTask).bind('click', {taskid: task.id}, function(){ return remove_task.apply(this, arguments); }).end().appendTo(#actSessionList); Hope that helps. Cheers, -- Jesse Skinner http://www.thefutureoftheweb.com dec wrote: On Apr 17, 8:22 pm, dec [EMAIL PROTECTED] wrote: Hi list, I'm trying to add items to an unordered list using jQuery. This is something triggered by another event, so it cannot be done within my HTML templating engine whilst building the page. I also wish to add an 'a' element within the list item which I can then use to remove the item and post an AJAX request at a later point. I had come up with the following with some assistance on #jquery: $( li style=\display: none\+ [+task.client.code+] +task.project.name+ br/+task.name+br/+ a class='removeTask' href='#'Remove/a+ /li ).find(a.removeTask).bind('click', {taskid: task.id}, remove_task ).end().appendTo(#actSessionList); My understanding is that this should: build the HTML, find any elements matching 'a.removeTask' within that HTML and bind them to remove_task() passing taskid within event.data and then add the initial HTML to my unordered list (#actSessionList). This seems to work fine when I call it the first time, but for any subsequent calls (with new data in the 'task' variable), the .bind(...) call overwrites the binding of the previous items and causes all their 'Remove' links to call remove_task with the wrong value of task.id. Is this incorrect behavior for the code I've written or am I not grasping the concept completely? My initial thought is that I'm not being explicit enough when selecting the 'a' element to _only_ receive the single element within that list item, but I'm too new to JavaScript to know how to debug this. Any help or comments are much appreciated. Regards, Tom Ah hah, just discovered that this is a bug! (http://dev.jquery.com/ ticket/935) So I'm not crazy after all... well maybe just a little... :) -Tom
[jQuery] jQuery tutorial on IBM DeveloperWorks
I wrote a jQuery tutorial for IBM DeveloperWorks which went live today: http://www.ibm.com/developerworks/library/x-ajaxjquery.html Cheers, Jesse Skinner www.thefutureoftheweb.com