[jQuery] Sort options in select.
Hello all, What's the best way to sort options in select. I found a jquery plugin sortOptions(), but if I have options: Address 1 Address 2 Address 3 Address 100 Address 200 , will be sort like this: Address 1 Address 100 Address 2 Address 200 Address 3 ...and is not good. Do you have another solution, or how can I adapt this one to do a good sorting.
[jQuery] SlideDown Issue.. help!
I am new to jQuery but am using it to SlideDown a DIV element when the a:link is clicked. However, no matter what link i click on the page, it slides down the div, it's as if the script has taken over every link on the page. Here is the code: script src=http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/ jquery.min.js/script script type=text/javascript charset=utf-8 $(document).ready(function () { var $div = $('#alias-box'); var height = $div.height(); $div.hide().css({ height : 0 }); $('a').click(function () { if ($div.is(':visible')) { $div.animate({ height: 0 }, { duration: 250, complete: function () { $div.hide(); } }); } else { $div.show().animate({ height : height }, { duration: 250 }); } return false; }); }); /script html: a href=#alias-box style=font-size:10px;Custom Alias/a div id=alias-boxinput name=new_alias class=field_50 type=text //div so clicking Custom Alias, drops the 'alias-box' div. But even when i click other links such as: a href=contact.phpContact/a it ignores going to contact.php and displays the div. Any ideas how to fix this?
Re: [jQuery] SlideDown Issue.. help!
ok heres an HTML structure style type=text/css * { /* css reset */ margin:0; padding:0; } .work { /* this prevents the content from still being shown when you slide up */ overflow:hidden; } /style div class=work a href=# class=slidecontrolslide controller/a div class=content put a lot of content in here /div /div EXPLANATION 1. we have a div wrapper. 2. we create a hyperlink and add the class slidecontrol 3. we create a content div THE SCRIPT script type=text/javascript // you can use this instead of $(document).ready( $(function() { var obj = $(. work): // we store our wrapper in a variable var slidecontrol = $(.slidecontrol, obj); // we select our slide controller from within the wrapper var content = $(.content, obj); // select the content from within the object; var switcher = 0; slidecontrol.click(function(e) { // i added a pre-defined variable e in the click event, this is defined in jquery e.preventDefault(); // prevents jumping to the top of the page if(switcher == 0) { // if switch = 0 slide up content.animate({ marginTop:-+content.height()+px}, 500); } else if(switcher == 1) { // if switch = 1 slide down content.animate({ marginTop:0}, 500); } }); }); /script On Mon, Jan 18, 2010 at 12:10 PM, for...@gmail.com for...@gmail.com wrote: I am new to jQuery but am using it to SlideDown a DIV element when the a:link is clicked. However, no matter what link i click on the page, it slides down the div, it's as if the script has taken over every link on the page. Here is the code: script src=http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/ jquery.min.js/script script type=text/javascript charset=utf-8 $(document).ready(function () { var $div = $('#alias-box'); var height = $div.height(); $div.hide().css({ height : 0 }); $('a').click(function () { if ($div.is(':visible')) { $div.animate({ height: 0 }, { duration: 250, complete: function () { $div.hide(); } }); } else { $div.show().animate({ height : height }, { duration: 250 }); } return false; }); }); /script html: a href=#alias-box style=font-size:10px;Custom Alias/a div id=alias-boxinput name=new_alias class=field_50 type=text //div so clicking Custom Alias, drops the 'alias-box' div. But even when i click other links such as: a href=contact.phpContact/a it ignores going to contact.php and displays the div. Any ideas how to fix this?
Re: [jQuery] SlideDown Issue.. help!
Hello forcer and all, You have: $('a').click(function()... This tells jQuery to perform the function on a click to every a link. -- With best regards from Ukraine, Andre Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ jabber.org Yahoo! messenger: andre.polykanine; ICQ: 191749952 Twitter: m_elensule - Original message - From: for...@gmail.com for...@gmail.com To: jQuery (English) jquery-en@googlegroups.com Date: Monday, January 18, 2010, 12:10:58 PM Subject: [jQuery] SlideDown Issue.. help! I am new to jQuery but am using it to SlideDown a DIV element when the a:link is clicked. However, no matter what link i click on the page, it slides down the div, it's as if the script has taken over every link on the page. Here is the code: script src=http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/ jquery.min.js/script script type=text/javascript charset=utf-8 $(document).ready(function () { var $div = $('#alias-box'); var height = $div.height(); $div.hide().css({ height : 0 }); $('a').click(function () { if ($div.is(':visible')) { $div.animate({ height: 0 }, { duration: 250, complete: function () { $div.hide(); } }); } else { $div.show().animate({ height : height }, { duration: 250 }); } return false; }); }); /script html: a href=#alias-box style=font-size:10px;Custom Alias/a div id=alias-boxinput name=new_alias class=field_50 type=text //div so clicking Custom Alias, drops the 'alias-box' div. But even when i click other links such as: a href=contact.phpContact/a it ignores going to contact.php and displays the div. Any ideas how to fix this?
[jQuery] Ajax calls and Internet Explorer performance problems
Hallo all. I ran into a performance problem with Internet Explorer. I got an homepage similar to iGoogle that makes a lot of ajax calls to populate different kinds of widget (from 5 to 20). When the widgets are loaded on Internet Explorer the user interaction is freezed and until the loading is done the user cannot interact with any element of the page. Is there any known performance issue with IE with a lot of AJAX calls since the XHR object is different from other browsers? Kind regards Massimo
[jQuery] Re: SlideDown Issue.. help!
Hi, can you tell me the alternative to make it only work on the select 'a' On Jan 18, 11:56 am, Andre Polykanine an...@oire.org wrote: Hello forcer and all, You have: $('a').click(function()... This tells jQuery to perform the function on a click to every a link. -- With best regards from Ukraine, Andre Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ jabber.org Yahoo! messenger: andre.polykanine; ICQ: 191749952 Twitter: m_elensule - Original message - From: for...@gmail.com for...@gmail.com To: jQuery (English) jquery-en@googlegroups.com Date: Monday, January 18, 2010, 12:10:58 PM Subject: [jQuery] SlideDown Issue.. help! I am new to jQuery but am using it to SlideDown a DIV element when the a:link is clicked. However, no matter what link i click on the page, it slides down the div, it's as if the script has taken over every link on the page. Here is the code: script src=http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/ jquery.min.js/script script type=text/javascript charset=utf-8 $(document).ready(function () { var $div = $('#alias-box'); var height = $div.height(); $div.hide().css({ height : 0 }); $('a').click(function () { if ($div.is(':visible')) { $div.animate({ height: 0 }, { duration: 250, complete: function () { $div.hide(); } }); } else { $div.show().animate({ height : height }, { duration: 250 }); } return false; }); }); /script html: a href=#alias-box style=font-size:10px;Custom Alias/a div id=alias-boxinput name=new_alias class=field_50 type=text //div so clicking Custom Alias, drops the 'alias-box' div. But even when i click other links such as: a href=contact.phpContact/a it ignores going to contact.php and displays the div. Any ideas how to fix this?
[jQuery] Validation plugin
I am testing this plugin (in conjunction with another called 'InFieldLabel.js' that merely fades back the label on focus) and am getting a strange effect where only some of the fields validate. The test page is: http://www.richardbarnfather.co.uk/esu/php/booking_mike.php All fields have a class of 'required' and the email field has additionally the class of 'email'. Leave all fields blank and click Submit and you'll see what I mean. If anyone can shed any light on why this is happening, I would be very grateful.
[jQuery] Select part of text and add a CSS class
Hi, I am trying to create my first jQuery script. I want to have a text in a p, select it with the cursor and add a class to it. I know that I can use the .select and .addClass functions. $(p).live(mouseup, function() { selection = getSelectedText(); if(selection.length = 3) { $(this).html($(this).html().addClass(selected); } } ); //Grab selected text function getSelectedText(){ if(window.getSelection){ return window.getSelection().toString(); } else if(document.getSelection){ return document.getSelection(); } else if(document.selection){ return document.selection.createRange().text; } } I can not get this to work. Thank you.
[jQuery] .add() strange behavior?
Hi all... I've come across something that I think is a little odd, but I'm not sure if I'm just being dumb. Have a look at this: $(function() { var $div = $(div); var $divs = $(); $divs.add($div); console.log($divs.length); // == 0 $divs = $().add($div); console.log($divs.length); // == 1 }); Logic tells me that $divs.length should be 1 in both cases. I've tested this with 1.3.2 and 1.4 and they both do the same thing, with the exception that in 1.3.2 the $() call creates a jQuery object with the document object in it, so the numbers return 1 and 2 instead of 0 and 1. Any ideas? Cheers, Matt Parlane
[jQuery] Re: appending link to head problem
Hi, same problem here. After a little rewrite, IE seems to understand this: var link = $(link/).appendTo($(head)); link.attr({ rel: stylesheet, href: path }); Anybody knows any details why IE doesn't like the link-append in jQuery 1.4? On 15 Jan., 03:21, easyOne yes...@gmail.com wrote: I tried to append link tag to head tag. For this, I wrote $(link/,{...}).appendTo(head); // jquery 1.4 style or $(head).append(link href /); // jquery 1.3.2 style . Both work nice on Firefox, Chrome, Safari, Opera but IE... In case of IE, it works with jQuery1.3.2, but never do anything with 1.4. Inspecting DOM, there's surely appended link tag to head.
[jQuery] jquery 1.4 and jqueryui tabs with ajax load
I've upgraded to jquery 1.4 and my tabs with ajax load no longer work. uncaught exception: jQuery UI Tabs: Mismatching fragment identifier. When I use the previous jquery version, everything works fine. Any idea on how to solve this? Thanks
[jQuery] Superfish jquery.noconflict and ajax problem
Having a big issue here on my joomla website. I'm trying to integrate a video component called Jvideodirect. The main listings portion of Jvideo is run by ajax and has a tab system. You can see the page in question here: http://www.globallinkup.net/video.html When you click on any of the page items with the dot above them (e.g., Featured, Recent, Popular, etc.), only the video list should change; the window should remain the same with the template intact. See demo (http://demo.jvideodirect.com/) On my site, however, a new page open up with the template broken. The Jvideo staff says it's an issue with the Superfish js files. And they're right; as soon as I disable them, the video component works as it's designed to. From what I can tell, the Superfish files are in jquery.noconflict mode. Can someone please help? I'm at a loss here.
[jQuery] Reduce Image Quality
Hello everybody, I'm getting a problem in my server, for example when someone want to upload an image with 5mb of size, on the server side is kinda impossible to upload that, max size is 2mb and I cannot modify it because is rented host. Now my question is... there is some stuff on client/browser side to reduce the quality of an image converting any size of them in less than 1mb ? Thanks for reading -- - Bortoli German - Blog: http://www.geoks.com.ar
Re: [jQuery] Reduce Image Quality
German Bortoli wrote: Hello everybody, I'm getting a problem in my server, for example when someone want to upload an image with 5mb of size, on the server side is kinda impossible to upload that, max size is 2mb and I cannot modify it because is rented host. Now my question is... there is some stuff on client/browser side to reduce the quality of an image converting any size of them in less than 1mb ? Thanks for reading -- - Bortoli German - Blog: http://www.geoks.com.ar There are Flash and java applets that can do this for you. You can't do this with plain javascript, AFAIK (at least not in all browsers). Jonathan -- www.tnt.be http://www.tnt.be/?source=emailsig *Jonathan Vanherpe* jonat...@tnt.be mailto:jonat...@tnt.be - www.tnt.be http://www.tnt.be/?source=emailsig - tel.: +32 (0)9 3860441
Re: [jQuery] Reduce Image Quality
2010/1/18 Jonathan Vanherpe (T T NV) jonat...@tnt.be German Bortoli wrote: Hello everybody, I'm getting a problem in my server, for example when someone want to upload an image with 5mb of size, on the server side is kinda impossible to upload that, max size is 2mb and I cannot modify it because is rented host. Now my question is... there is some stuff on client/browser side to reduce the quality of an image converting any size of them in less than 1mb ? Thanks for reading -- - Bortoli German - Blog: http://www.geoks.com.ar There are Flash and java applets that can do this for you. You can't do this with plain javascript, AFAIK (at least not in all browsers). Jonathan -- [image: www.tnt.be] http://www.tnt.be/?source=emailsig *Jonathan Vanherpe* jonat...@tnt.be - www.tnt.be http://www.tnt.be/?source=emailsig - tel.: +32 (0)9 3860441 Nice, could you give me some names about that or some example if is possible, I was looking for it on google, and didn't find it. -- - Bortoli German - Web: http://ventalocal.com.ar Blog: http://www.geoks.com.ar
Re: [jQuery] Select part of text and add a CSS class
On Mon, Jan 18, 2010 at 6:02 AM, Mircea i...@amsterdamsat.com wrote: I am trying to create my first jQuery script. I want to have a text in a p, select it with the cursor and add a class to it. I know that I can use the .select and .addClass functions. I bet you need to wrap the selected text in a span - you can't apply a class to an arbitrary block of text, you know? Might not be the only problem with your script but I bet it's at least part of it. :) Good luck, Nathan
Re: [jQuery] Validation plugin
On Mon, Jan 18, 2010 at 4:55 AM, perkin5 mshe...@btinternet.com wrote: http://www.richardbarnfather.co.uk/esu/php/booking_mike.php All fields have a class of 'required' and the email field has The fields that aren't validating have typos in the class setting - they're missing the equals sign: classrequired instead of class=required.
[jQuery] new forums used?
Hi there, I just noticed this group is still having lots of activity. I for one am very pleased to see we're moving to actual forum on forum.jquery.com, but it appears that moderation isn't done there yet (or I'm just too impatient...) Are we supposed to continue posting here, or was my first idea right to start using the new forum? Thanks so much for a fantastic library, great support, and a marvellous spirit :) David.
Re: [jQuery] Reduce Image Quality
German Bortoli wrote: 2010/1/18 Jonathan Vanherpe (T T NV) jonat...@tnt.be mailto:jonat...@tnt.be German Bortoli wrote: Hello everybody, I'm getting a problem in my server, for example when someone want to upload an image with 5mb of size, on the server side is kinda impossible to upload that, max size is 2mb and I cannot modify it because is rented host. Now my question is... there is some stuff on client/browser side to reduce the quality of an image converting any size of them in less than 1mb ? Thanks for reading -- - Bortoli German - Blog: http://www.geoks.com.ar There are Flash and java applets that can do this for you. You can't do this with plain javascript, AFAIK (at least not in all browsers). Jonathan -- www.tnt.be http://www.tnt.be/?source=emailsig *Jonathan Vanherpe* jonat...@tnt.be mailto:jonat...@tnt.be - www.tnt.be http://www.tnt.be/?source=emailsig - tel.: +32 (0)9 3860441 Nice, could you give me some names about that or some example if is possible, I was looking for it on google, and didn't find it. -- - Bortoli German - After googling (http://www.google.com/search?name=fhl=enq=flash+image+upload+resize) for a few minutes I found this: http://code.google.com/p/swfupload/ I'm sure there are others, but I haven't used any of them, so don't ask me which one's best ;-). Jonathan -- www.tnt.be http://www.tnt.be/?source=emailsig *Jonathan Vanherpe* jonat...@tnt.be mailto:jonat...@tnt.be - www.tnt.be http://www.tnt.be/?source=emailsig - tel.: +32 (0)9 3860441
Re: [jQuery] Reduce Image Quality
2010/1/18 Jonathan Vanherpe (T T NV) jonat...@tnt.be German Bortoli wrote: 2010/1/18 Jonathan Vanherpe (T T NV) jonat...@tnt.be German Bortoli wrote: Hello everybody, I'm getting a problem in my server, for example when someone want to upload an image with 5mb of size, on the server side is kinda impossible to upload that, max size is 2mb and I cannot modify it because is rented host. Now my question is... there is some stuff on client/browser side to reduce the quality of an image converting any size of them in less than 1mb ? Thanks for reading -- - Bortoli German - Blog: http://www.geoks.com.ar There are Flash and java applets that can do this for you. You can't do this with plain javascript, AFAIK (at least not in all browsers). Jonathan -- [image: www.tnt.be] http://www.tnt.be/?source=emailsig *Jonathan Vanherpe* jonat...@tnt.be - www.tnt.be http://www.tnt.be/?source=emailsig - tel.: +32 (0)9 3860441 Nice, could you give me some names about that or some example if is possible, I was looking for it on google, and didn't find it. -- - Bortoli German - After googling ( http://www.google.com/search?name=fhl=enq=flash+image+upload+resize) for a few minutes I found this: http://code.google.com/p/swfupload/ I'm sure there are others, but I haven't used any of them, so don't ask me which one's best ;-). Jonathan -- [image: www.tnt.be] http://www.tnt.be/?source=emailsig *Jonathan Vanherpe* jonat...@tnt.be - www.tnt.be http://www.tnt.be/?source=emailsig - tel.: +32 (0)9 3860441 I just found too uploadify, that use JQuery... :D Will test both. Thanks a lot for answer. -- - Bortoli German - Web: http://ventalocal.com.ar Blog: http://www.geoks.com.ar
RE: [jQuery] new forums used?
Hi, David... What do you find more appealing about forums than an email list? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of speedpac...@gmail.com Sent: Monday, January 18, 2010 9:50 AM To: jQuery (English) Subject: [jQuery] new forums used? Hi there, I just noticed this group is still having lots of activity. I for one am very pleased to see we're moving to actual forum on forum.jquery.com, but it appears that moderation isn't done there yet (or I'm just too impatient...) Are we supposed to continue posting here, or was my first idea right to start using the new forum? Thanks so much for a fantastic library, great support, and a marvellous spirit :) David.
Re: [jQuery] Re: SlideDown Issue.. help!
On Mon, Jan 18, 2010 at 6:19 AM, for...@gmail.com for...@gmail.com wrote: Hi, can you tell me the alternative to make it only work on the select 'a' Simplest way is to give the 'a' an id: a id=alias-box-link href=#alias-box style=font-size:10px;Custom Alias/a Then set its click handler this in the Javascript like this: $('a#alias-box-link').click(function () { Otherwise, depending on what else you have going on, you could do something like what Waseem suggested or something like this example: http://jsbin.com/aqoti/edit Nathan
[jQuery] Re: new forums used?
well, for starters the fact that Google does not accept my emails to the list, een though I'm subscribed, so for some reason it forces me to go to groups.google.com to submit any messages I'd like to submit, which to be honest has limited my contribution on the list to just some questions helping me, and noty contributing to solutions to other people's problems. Secondly - I prefer not to have too many email arriving; I prefer the pull mechanism where I decide to go read on the forum; I always have the feeling that mailing lists just push you with the info. And thirdly - the new forums look great :D Either way - from what I've read the list IS gonna disappear and IS gonna be replaced by the new forum; just not clear to me whether we're supposed to write here, or use the new forums now... Thanks! David. On 18 jan, 16:03, Rick Faircloth r...@whitestonemedia.com wrote: Hi, David... What do you find more appealing about forums than an email list? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of speedpac...@gmail.com Sent: Monday, January 18, 2010 9:50 AM To: jQuery (English) Subject: [jQuery] new forums used? Hi there, I just noticed this group is still having lots of activity. I for one am very pleased to see we're moving to actual forum on forum.jquery.com, but it appears that moderation isn't done there yet (or I'm just too impatient...) Are we supposed to continue posting here, or was my first idea right to start using the new forum? Thanks so much for a fantastic library, great support, and a marvellous spirit :) David.
[jQuery] Reset range slider values
I setup a slider using jQuery(id).slider({ range:true, min: 1, max: 100, step: 1, values: [1, 100]} After I moved the slider handles I try to reset the values: jQuery(id).slider('option', 'min', 1); //works jQuery(id).slider('option', 'max', 100); //works jQuery(id).slider('option', 'values', [1,100]); //does not work! The min and max are reset but the handles stay where they are. Is this a bug? For single silder this works jQuery(id).slider('option', 'value', 1); Thanks! Bruce
[jQuery] Re: new forums used?
As long as your questions/issues continue to get answered, it shouldn't matter where you post as there's plenty of people on one or the other..or both :-) At some point perhaps this mailing list will just get turned off, but there should, and appears to be, a transition period where both are active On Jan 18, 10:28 am, speedpac...@gmail.com speedpac...@gmail.com wrote: well, for starters the fact that Google does not accept my emails to the list, een though I'm subscribed, so for some reason it forces me to go to groups.google.com to submit any messages I'd like to submit, which to be honest has limited my contribution on the list to just some questions helping me, and noty contributing to solutions to other people's problems. Secondly - I prefer not to have too many email arriving; I prefer the pull mechanism where I decide to go read on the forum; I always have the feeling that mailing lists just push you with the info. And thirdly - the new forums look great :D Either way - from what I've read the list IS gonna disappear and IS gonna be replaced by the new forum; just not clear to me whether we're supposed to write here, or use the new forums now... Thanks! David. On 18 jan, 16:03, Rick Faircloth r...@whitestonemedia.com wrote: Hi, David... What do you find more appealing about forums than an email list? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of speedpac...@gmail.com Sent: Monday, January 18, 2010 9:50 AM To: jQuery (English) Subject: [jQuery] new forums used? Hi there, I just noticed this group is still having lots of activity. I for one am very pleased to see we're moving to actual forum on forum.jquery.com, but it appears that moderation isn't done there yet (or I'm just too impatient...) Are we supposed to continue posting here, or was my first idea right to start using the new forum? Thanks so much for a fantastic library, great support, and a marvellous spirit :) David.
Re: [jQuery] new forums used?
If the forum is prefered by some users, that's OK, but I don't think it is a good idea to kill the mailing lists, because there are many users that prefer reading a mailing list. The forums will *always* be much less accessible for the blind users for example so it would be much helpful if both ways of communicating will coexist. If some of the users won't like the forum, they would be able to use the mailing lists, while if other users wouldn't want to receive the emails from the mailing list they could just unsubscribe, so the mailing lists won't hurt anyone. Octavian - Original Message - From: speedpac...@gmail.com To: jQuery (English) jquery-en@googlegroups.com Sent: Monday, January 18, 2010 4:50 PM Subject: [jQuery] new forums used? Hi there, I just noticed this group is still having lots of activity. I for one am very pleased to see we're moving to actual forum on forum.jquery.com, but it appears that moderation isn't done there yet (or I'm just too impatient...) Are we supposed to continue posting here, or was my first idea right to start using the new forum? Thanks so much for a fantastic library, great support, and a marvellous spirit :) David.
Re: [jQuery] new forums used?
On Mon, Jan 18, 2010 at 10:05 AM, Octavian Rasnita orasn...@gmail.com wrote: If some of the users won't like the forum, they would be able to use the mailing lists, while if other users wouldn't want to receive the emails from the mailing list they could just unsubscribe, so the mailing lists won't hurt anyone. The mailing list is great but what's expected to happen shortly after they stop moderating it, reportedly a significant effort, is the list will be overrun by spammers. Hopefully their fears are unfounded but I'm not holding my breath. Nice knowin' y'all. ;) Nathan
[jQuery] Open/Save as dialog box
Hallo all. Is there a way to catch the event when the browser open to the user the classical Open/ Save as dialog box? http://qpack.orcanos.com/helpcenter/Images/openSave.png I need to do something when the dialog is shown. Kind regards Massimo
[jQuery] Re: Select part of text and add a CSS class
Yes, I want to be able to select a part of the text and add a span to it. Can this be done? Thank you.
[jQuery] JQuery Trigger Event
Hi, In JQuery I tried to trigger click event like below, based on their ID. $('#parent0').trigger(click); $('#parent1').trigger(click); This code seems to be work in Firefox. But when I tried the same in IE8, it does not work. Could any one update me, how to fix this. Thanks in Advance,
[jQuery] Autocomplete: How to prevent multiple queries(url) to the backend when there is no match
I'm trying to use autocomplete to send a query to our backend search engine. This is working very well, howver, we are notcing that when we submit a query for a substring such as foo and there is no match in the results a subsquent query is also been submitted for foobar to the backend. This is resulting in unnecessary query traffic, because if there is no match for foo no match can be expected for foobar. Is there a way to prevent subsquent queries from being submitted? Thanks in advance!
[jQuery] Superfish
I'm a beginner developing drupal on mysql. Looking for the easiest way to setup drop down menus, since NICE MENUS seems to disapear for all user's asside from the master user. Is Superfish for me?
Re: [jQuery] JQuery Trigger Event
On Mon, Jan 18, 2010 at 10:30 AM, ashar udeen asharud...@gmail.com wrote: $('#parent1').trigger(click); This code seems to be work in Firefox. But when I tried the same in IE8, it does not work. Could any one update me, how to fix this. Have you tried just $('#parent1').click()?
[jQuery] Re: Select part of text and add a CSS class
yes, it indeed is selection = getSelectedText(); if(selection.length = 3) { $(this).html($(this).html().addClass(selected); } to selection = getSelectedText(); if(selection.length = 3) { var $spn = $(span/span).html(selection).addClass (selected); // append/set this '$spn' inside another DOM object } to note, your original/non-working code seems to be trying to set the .html of an input or textarea, that's not a valid method to do on such items On Jan 18, 11:46 am, Mircea i...@amsterdamsat.com wrote: Yes, I want to be able to select a part of the text and add a span to it. Can this be done? Thank you.
[jQuery] $.ajax call doesn't complete on 400 bad request response
Can't seem to get any response from an ajax call which response is 400 Bad Request $.ajax({ url: url type: GET, dataType: json, success: aj.dataLoaded, error: function() { alert(error); }, complete: function() { alert(complete); } }); When server responds with error code 400 neither the error function nor the complete function is called, any tips on how to correct this? Could there be a problem with parsing output, since this particular response also gives an error message in text/plain not JSON? Have tried with both processData set to false and true but with the same problem... Have tried both jQuery 1.3 and 1.4 -- Anton
Re: [jQuery] $.ajax call doesn't complete on 400 bad request response
On Mon, Jan 18, 2010 at 11:05 AM, anton anton.johans...@gmail.com wrote: Can't seem to get any response from an ajax call which response is 400 Bad Request $.ajax({ url: url type: GET, dataType: json, success: aj.dataLoaded, error: function() { alert(error); }, complete: function() { alert(complete); } }); When server responds with error code 400 neither the error function nor the complete function is called, any tips on how to correct this? What is aj.dataLoaded doing? I believe a 400 will go to the success callback; after that finishes (assuming it does so :) it should call the complete callback. Can the call to complete be disabled by returning false from the success/error callback? Nathan
[jQuery] Re: Select part of text and add a CSS class
Thanx for the code. It does not work to me. I am a newbye is JQuery, please excuse the dumb questions... This is my code and markup: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html head script src=http://code.jquery.com/jquery-latest.js;/script script type=text/javascript src=http://jqueryui.com/latest/ui/ ui.core.js/script script type=text/javascript src=http://jqueryui.com/latest/ui/ ui.draggable.js/script script type=text/javascript $(document).ready(function(){ $(p).live(mouseup, function() { selection = getSelectedText(); if(selection.length = 3) { var $spn = $(span/span).html(selection).addClass (selected); // append/set this '$spn' inside another DOM object } } ); //Grab selected text function getSelectedText(){ if(window.getSelection){ return window.getSelection().toString(); } else if(document.getSelection){ return document.getSelection(); } else if(document.selection){ return document.selection.createRange().text; } } }); /script style p { color:blue; } div { color:red; } span.hl { background: yellow; } #selected {background: yellow;} .selected {background: yellow;} /style /head body div id=#container pthis is the text to be selected - a part of it/div /body /html
[jQuery] Re: $.ajax call doesn't complete on 400 bad request response
success function is not called at all when I receiver error code 400: success: function() { alert(success); }, error: function() { alert(error); }, complete: function() { alert(complete); } None of those are called, and I don't get javascript errors in console... On Jan 18, 6:23 pm, Nathan Klatt n8kl...@gmail.com wrote: On Mon, Jan 18, 2010 at 11:05 AM, anton anton.johans...@gmail.com wrote: Can't seem to get any response from an ajax call which response is 400 Bad Request $.ajax({ url: url type: GET, dataType: json, success: aj.dataLoaded, error: function() { alert(error); }, complete: function() { alert(complete); } }); When server responds with error code 400 neither the error function nor the complete function is called, any tips on how to correct this? What is aj.dataLoaded doing? I believe a 400 will go to the success callback; after that finishes (assuming it does so :) it should call the complete callback. Can the call to complete be disabled by returning false from the success/error callback? Nathan
RE: [jQuery] new forums used?
+ 1 Why not have both? (beside possible spammers)... I use the CF-Talk list constantly and it's email- and forum-based. Messages go to both email and the forum. Does the forum have subscribe to this thread capability? What the URL for the forum, anyway? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Octavian Rasnita Sent: Monday, January 18, 2010 11:05 AM To: jquery-en@googlegroups.com Subject: Re: [jQuery] new forums used? If the forum is prefered by some users, that's OK, but I don't think it is a good idea to kill the mailing lists, because there are many users that prefer reading a mailing list. The forums will *always* be much less accessible for the blind users for example so it would be much helpful if both ways of communicating will coexist. If some of the users won't like the forum, they would be able to use the mailing lists, while if other users wouldn't want to receive the emails from the mailing list they could just unsubscribe, so the mailing lists won't hurt anyone. Octavian - Original Message - From: speedpac...@gmail.com To: jQuery (English) jquery-en@googlegroups.com Sent: Monday, January 18, 2010 4:50 PM Subject: [jQuery] new forums used? Hi there, I just noticed this group is still having lots of activity. I for one am very pleased to see we're moving to actual forum on forum.jquery.com, but it appears that moderation isn't done there yet (or I'm just too impatient...) Are we supposed to continue posting here, or was my first idea right to start using the new forum? Thanks so much for a fantastic library, great support, and a marvellous spirit :) David.
Re: [jQuery] new forums used?
From: Nathan Klatt n8kl...@gmail.com On Mon, Jan 18, 2010 at 10:05 AM, Octavian Rasnita orasn...@gmail.com wrote: If some of the users won't like the forum, they would be able to use the mailing lists, while if other users wouldn't want to receive the emails from the mailing list they could just unsubscribe, so the mailing lists won't hurt anyone. The mailing list is great but what's expected to happen shortly after they stop moderating it, reportedly a significant effort, is the list will be overrun by spammers. Hopefully their fears are unfounded but I'm not holding my breath. Nice knowin' y'all. ;) Well, this is not important at all. If the mailing list subscribers will dislike that spam so much, they will be able to unsubscribe anytime, but maybe some of them will happily accept that spam and also like to continue using the list. I am subscribed to the list with a Gmail address that takes care of most of the spam, and I also have an anti-spam application for other email accounts I use, so it is easier to use a spammed mailing list than a forum. Octavian
[jQuery] Re: Select part of text and add a CSS class
it probably is working, but you failed to *do* anything with the generated span tag... that's why i added as a comment: // append/set this '$spn' inside another DOM object On Jan 18, 12:29 pm, Mircea i...@amsterdamsat.com wrote: Thanx for the code. It does not work to me. I am a newbye is JQuery, please excuse the dumb questions... This is my code and markup: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html head script src=http://code.jquery.com/jquery-latest.js;/script script type=text/javascript src=http://jqueryui.com/latest/ui/ ui.core.js/script script type=text/javascript src=http://jqueryui.com/latest/ui/ ui.draggable.js/script script type=text/javascript $(document).ready(function(){ $(p).live(mouseup, function() { selection = getSelectedText(); if(selection.length = 3) { var $spn = $(span/span).html(selection).addClass (selected); // append/set this '$spn' inside another DOM object } } ); //Grab selected text function getSelectedText(){ if(window.getSelection){ return window.getSelection().toString(); } else if(document.getSelection){ return document.getSelection(); } else if(document.selection){ return document.selection.createRange().text; } } }); /script style p { color:blue; } div { color:red; } span.hl { background: yellow; } #selected {background: yellow;} .selected {background: yellow;} /style /head body div id=#container pthis is the text to be selected - a part of it/div /body /html
Re: [jQuery] $.ajax call doesn't complete on 400 bad request response
On Mon, Jan 18, 2010 at 11:05 AM, anton anton.johans...@gmail.com wrote: Can't seem to get any response from an ajax call which response is 400 Bad Request $.ajax({ url: url type: GET, Hey, is that missing comma after url a typo? Nathan
RE: [jQuery] new forums used?
it is easier to use a spammed mailing list than a forum. Yes... I would gladly put up with some spam to keep all messages flowing to my inbox, rather than having to use a forum. I can filter the spam as it arrives... -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Octavian Rasnita Sent: Monday, January 18, 2010 1:04 PM To: jquery-en@googlegroups.com Subject: Re: [jQuery] new forums used? From: Nathan Klatt n8kl...@gmail.com On Mon, Jan 18, 2010 at 10:05 AM, Octavian Rasnita orasn...@gmail.com wrote: If some of the users won't like the forum, they would be able to use the mailing lists, while if other users wouldn't want to receive the emails from the mailing list they could just unsubscribe, so the mailing lists won't hurt anyone. The mailing list is great but what's expected to happen shortly after they stop moderating it, reportedly a significant effort, is the list will be overrun by spammers. Hopefully their fears are unfounded but I'm not holding my breath. Nice knowin' y'all. ;) Well, this is not important at all. If the mailing list subscribers will dislike that spam so much, they will be able to unsubscribe anytime, but maybe some of them will happily accept that spam and also like to continue using the list. I am subscribed to the list with a Gmail address that takes care of most of the spam, and I also have an anti-spam application for other email accounts I use, so it is easier to use a spammed mailing list than a forum. Octavian
[jQuery] Re: selected accordion background
bump :-) On Jan 15, 7:13 pm, spiderling webmas...@spiderling.ca wrote: I'm using an accordion which functions perfectly. I was using jQuery 1.2.6 with UI 1.6 and was able to have a different background image displayed when the section was expanded using .selected. I upgraded to jQuery 1.3.2 with UI 1.7.2, and the selected / expanded background image no longer works. Everything else works fine. Any suggestions on how I can get it working again with 1.3.2 and 1.7.2? Thanks Pasquale // jQuery script type=text/javascript $(document).ready(function(){ $(#accordion1).accordion({ active: false, header: '.heading', collapsible: true, autoHeight: false });}); /script /** CSS **/ ul#accordion1 a.heading { background: url(/pics/bg1.jpg) repeat-x #b9a77d; font-family: Georgia, Times New Roman, Times, serif; color: #fff; display: block; outline: none; font-size: 13pt; font-weight: normal; line-height: 13pt; padding: 10px 5px; text-decoration: none;} ul#accordion1 a.heading:hover { background: url(/pics/bg2.jpg) repeat-x #dfd2b3; color: #00447f;} ul#accordion1 a.selected, ul#accordion1 a.selected:hover { background: url(/pics/bg3.jpg) repeat-x #00447f; color: #fff; } !-- HTML -- ul id=accordion1 li a class=heading href=#Heading 1/a ul li a href=link1.htmlLink 1/a/li li a href=link2.htmlLink 2/a/li li a href=link3.htmlLink 3/a/li /ul /li li a class=heading href=#Heading 2/a ul li a href=link1.htmlLink 1/a/li li a href=link2.htmlLink 2/a/li li a href=link3.htmlLink 3/a/li /ul /li /ul
[jQuery] Re: $.ajax call doesn't complete on 400 bad request response
A type, sorry, everything works fine without javascript warnings or errors, can seem to get any function to be called after a request which return 400. Just fixed the server so that it returns correct MIME-type application/javascript instead of just text for errors, this wasn't the problem though... $.ajax({ url: http://localhost:9998/search/; + searchVal + ? callback=?, type: GET, dataType: json, success: function() { alert(success); }, error: function() { alert(error); }, complete: function() { alert(complete); } }); Some Firebug info after a call: === GET http://localhost:9998/search/jonas?callback=jsonp1263842210822 400 Bad Request localhost:9998 Response Headers: Server grizzly/1.9.9 Content-Typeapplication/javascript Transfer-Encoding chunked DateMon, 18 Jan 2010 19:17:15 GMT Connection close Response = jsonp1263842210822({msg:[LDAP: error code 4 - Sizelimit Exceeded]}) I also find it strange that request is made with Accept Header = */* instead of application/json which is stated as dataType but should maybe be discussed in another topic... have tried using dataType : jsonp and skipped the callback info in url, this gives the exact same result though. On Jan 18, 7:09 pm, Nathan Klatt n8kl...@gmail.com wrote: On Mon, Jan 18, 2010 at 11:05 AM, anton anton.johans...@gmail.com wrote: Can't seem to get any response from an ajax call which response is 400 Bad Request $.ajax({ url: url type: GET, Hey, is that missing comma after url a typo? Nathan
Re: [jQuery] Re: selected accordion background
Pasquale, Looks like it no longer sets the class to selected for you; just gotta do it yourself. On Mon, Jan 18, 2010 at 12:31 PM, spiderling webmas...@spiderling.ca wrote: bump :-) On Jan 15, 7:13 pm, spiderling webmas...@spiderling.ca wrote: I'm using an accordion which functions perfectly. I was using jQuery 1.2.6 with UI 1.6 and was able to have a different background image displayed when the section was expanded using .selected. I upgraded to jQuery 1.3.2 with UI 1.7.2, and the selected / expanded background image no longer works. Everything else works fine. Any suggestions on how I can get it working again with 1.3.2 and 1.7.2? Thanks Pasquale // jQuery script type=text/javascript $(document).ready(function(){ $(#accordion1).accordion({ active: false, header: '.heading', collapsible: true, autoHeight: false }) .bind('accordionchange', function(event, ui) { $(ui.oldHeader).removeClass(selected); $(ui.newHeader). addClass(selected); }); }); /script Nathan
[jQuery] Re: Select part of text and add a CSS class
I've added $(p).append(spn) It ads only the text spn at the bottom of the text. I probably did not used the append function right to pass the variable to p. Thanx
[jQuery] Re: Select part of text and add a CSS class
the variable name/reference is $spn so it would be: $(p).append($spn); your line of $(p).append(spn) does exactly what you told it to do :-) On Jan 18, 2:34 pm, Mircea i...@amsterdamsat.com wrote: I've added $(p).append(spn) It ads only the text spn at the bottom of the text. I probably did not used the append function right to pass the variable to p. Thanx
[jQuery] coda slider nested in an accordion
Hello! I am fairly new to javascript and I could use some help debugging something. . .I created a page with a working accordion, but then I added a coda slider to one of the accordion tabs, and now the accordion does not work properly. . . I've been using firebug to debug, but I can't figure out what the conflict is. . . any help would be greatly appreciated. the page with the properly working accordion is http://misswakes.com/shimsham/2/ the page with the properly working slider and the wonky accordion is http://misswakes.com/shimsham/2/index2.html Thank you! ~Sarah -- View this message in context: http://old.nabble.com/coda-slider-nested-in-an-accordion-tp27215754s27240p27215754.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Select part of text and add a CSS class
Thanx a lot Morning. It does work this way All the best!
[jQuery] click action effect/problem
Hey, I've got a toolbar on the bottom of my website, and I've got it to where a user clicks on a div tag, and it reveals another div tag, which contains the content described in the previous div. So if a person clicks on the div with share in it, a hidden div is revealed containing links to various social bookmarking options. Now, the button div contains the div that has the content. It's sorta like this: div id=button Click here div id=submenu option 1 option 2 /div /div So, when you click on the button div, it reveals the sub-menu div. The problem is that when you click on the content within the sub-menu it activates the .click action attached to the button div. I'm fairly sure this is normal behavior, but I'm not sure how to prevent it. I'd to be able to click on the content within the sub- menu and not have it activate the .click action attached to the button div. The reason I put the sub-menu within the button div, is that the button div animates to a wider width, and if I didn't put it inside, it the sub-menu would stay in place and not shift with the button div. Sorry about all the wordiness. Any solutions would be greatly appreciated. My website: calxanime.com The jquery is contained at: http://calxanime.com/smf/Themes/mobile_alt/scripts/jquery.custom.js Sign in to see the bottom bar with the username: Guestperson and the password: guest Thanks, Legostrat
[jQuery] Re: click action effect/problem
Hope this helps put you on the path http://jsbin.com/ejuga3 (run) http://jsbin.com/ejuga3/edit (edit) Event Delegation = awesome knowledge to have http://www.learningjquery.com/2008/03/working-with-events-part-1 On Jan 18, 4:07 pm, Legostrat legost...@gmail.com wrote: Hey, I've got a toolbar on the bottom of my website, and I've got it to where a user clicks on a div tag, and it reveals another div tag, which contains the content described in the previous div. So if a person clicks on the div with share in it, a hidden div is revealed containing links to various social bookmarking options. Now, the button div contains the div that has the content. It's sorta like this: div id=button Click here div id=submenu option 1 option 2 /div /div So, when you click on the button div, it reveals the sub-menu div. The problem is that when you click on the content within the sub-menu it activates the .click action attached to the button div. I'm fairly sure this is normal behavior, but I'm not sure how to prevent it. I'd to be able to click on the content within the sub- menu and not have it activate the .click action attached to the button div. The reason I put the sub-menu within the button div, is that the button div animates to a wider width, and if I didn't put it inside, it the sub-menu would stay in place and not shift with the button div. Sorry about all the wordiness. Any solutions would be greatly appreciated. My website: calxanime.com The jquery is contained at:http://calxanime.com/smf/Themes/mobile_alt/scripts/jquery.custom.js Sign in to see the bottom bar with the username: Guestperson and the password: guest Thanks, Legostrat
[jQuery] JQuery and AJAX Heartbeat question
Hi there, I have a PHP script called zip.php to generate a zip file. This requires more than 30 seconds so my server give me an server error 500 time-out. Can i avoid this 500 error with JQuery and AJAX heartbeat? Greetz
[jQuery] Re: click action effect/problem
On Jan 18, 4:07 pm, Legostrat legost...@gmail.com wrote: div id=button Click here div id=submenu option 1 option 2 /div /div So, when you click on the button div, it reveals the sub-menu div. The problem is that when you click on the content within the sub-menu it activates the .click action attached to the button div. I didn't go to the live site, but if your markup is as simple as that (i.e. Click here is directly in the outer div) then this might be all you need: $(#button).click(function(event) { if (event.target.id != button) return; $(#submenu).toggle(); }); If the click here is nested deeper, you might need something more like this: $(#button).click(function(event) { if ($(event.target).closest(#submenu).length) return; $(#submenu).toggle(); }); The idea is simply to ignore those events that are inside the submenu. Cheers, -- Scott
[jQuery] Re: JQuery and AJAX Heartbeat question
On Jan 18, 4:25 pm, mind01 mindproduction...@gmail.com wrote: I have a PHP script called zip.php to generate a zip file. This requires more than 30 seconds so my server give me an server error 500 time-out. Can i avoid this 500 error with JQuery and AJAX heartbeat? Probably not. AJAX is just going to give you additional HTTP requests, and won't change what's happening on the server for the initial request. One possibility would be to have your script start a process that will do the zipping and then use AJAX to poll from the client to see if the zipping is complete. Once it's finished, you can download it or do whatever else you need. The process you start would probably have to be a bit more complicated than just zip. You might want to start something that zips to a temporary file and when that's complete renames it to the file name you'll be polling for. Otherwise, PHP might tell you that the file is ready even though its still being built. Good luck, -- Scott
[jQuery] Re: Select part of text and add a CSS class
On Jan 18, 11:46 am, Mircea i...@amsterdamsat.com wrote: Yes, I want to be able to select a part of the text and add a span to it. Can this be done? It's a very difficult problem to solve in the general case. Imagine this markup: pIt's a strongvery difficult problem/strong to emsolve in the general case/em./p And then you want to select the text difficult problem to solve. You would essentially need to transform that markup to something like this: pIt's a strongvery /strong span class=highlight strongproblem/span to emsolve/em /span emin the general case/em./p Is this doable? Yes. Easy? Far from it. -- Scott
[jQuery] Re: 14 Days of jQuery - Donation for free ebook
Did you ever hear back about this? I'm in the same boat. On Jan 13, 11:06 am, Peter Duerden peterduer...@gmail.com wrote: I made adonationvia PayPal that qualifies to receive a random free ebook (seehttp://jquery14.com/donate). Just wondering how/when I would hear about obtaining the book? Of have I jumped the gun by making mydonationtoo early and not during the 14 Days of jQuery?
[jQuery] Re: 14 Days of jQuery - Donation for free ebook
It says Jan 19 books will be distributed. On Jan 13, 11:06 am, Peter Duerden peterduer...@gmail.com wrote: I made adonationvia PayPal that qualifies to receive a random free ebook (seehttp://jquery14.com/donate). Just wondering how/when I would hear about obtaining the book? Of have I jumped the gun by making mydonationtoo early and not during the 14 Days of jQuery?
[jQuery] Re: Open/Save as dialog box
On Jan 18, 11:27 am, m.ugues m.ug...@gmail.com wrote: Is there a way to catch the event when the browser open to the user the classical Open/ Save as dialog box?http://qpack.orcanos.com/helpcenter/Images/openSave.png I need to do something when the dialog is shown. I don't know for sure, but I would doubt it. It's too close to OS operations. -- Scott
[jQuery] (validate) (remote) How to check a returning user without locking the submission?
Hi there. I'm working on a quiz where you can submit another time your answers (yes, I want them to win ;-). But if you do so, I'd like to display a warning that tells you that you have already submitted and that your new submission will erase the previous one. I've used the remote feature on the 'name' field to check if a user has already submitted : with success but then, the form is locked and I can't submit until I fill an unplayed 'name'. #1 So, can I use the remote feature to check a returning player but still allowing that user to submit? I hide my custom warning div at start and displays it if 'remote' triggers. #2 How can I hide that div if the user change its name? Here is my script, thanks a lot for your advices : $(document).ready(function(){ $(#alreadyplayed).hide(); // this is my div warning telling you that you have already played $(#formQuiz).validate({ rules: { name: { required: true, remote: { url: scripts/namecheck.php, // checks if 'name' has already played type: post } } }, messages: { name: { required: required, remote: function(){ $(#alreadyplayed).show(); // displays my custom div warning return You already played! // display the regular 'remote' error message } } }, submitHandler: function(form) { form.submit(); } }); });
[jQuery] XPath Selectors / Custom Selectors - Error?
In the list at http://docs.jquery.com/DOM/Traversing/Selectors#XPath_Selectors, shouldn't :eq(0) and :nth(0) Selects the Nth element... be :eq(N) and :nth(N)?
[jQuery] [mcDropdown] Enhancement Request
Howdy... The GivaInc.com site says that the devs monitor this list for stuff and they don't give out their emails anywhere on the site. So... The mcDropdown is great but needed a little push from me in order to get the field to display properly on a form with labels to the left of the field (versus above). Because of that I needed to have a way to create css for the anchor and wrapper div tags inserted by the mcDropdown plugin. I added the following two new defaults: , wrapperId: null // The id of the wrapper for more css control ... added 2010-01-18 Jerry Ablan jab...@pogostick.com , anchorId: null // The id of the anchor for more css control ... added 2010-01-18 Jerry Ablan jab...@pogostick.com In addition, the following was changed at line 160 (after insert of above two lines): // create the div to wrap everything in $divInput = $('div class=mcdropdowna ' + ( settings.anchorId ! == null ? ' id=' + settings.anchorId + ' ' : '' ) + 'href=# tabindex=-1/ainput type=hidden name=' + (el.name || el.id) + ' id=' + (el.id || el.name) + ' //div') .appendTo($('div ' + ( settings.wrapperId !== null ? 'id=' + settings.wrapperId + ' ' : '' ) + 'style=position: relative;/ div')) .parent(); With the wrapper div and anchor accessible now, I can style the CSS to get the field in the right place. Thanks!
[jQuery] (validate) plugin
Hi there. I'm working on a quiz where you can submit another time your answers (yes, I want them to win ;-). But if you do so, I'd like to display a warning that tells you that you have already submitted and that your new submission will erase the previous one. I've used the remote feature on the 'name' field to check if a user has already submitted : with success but then, the form is locked and I can't submit until I fill an unplayed 'name'. #1 So, can I use the remote feature to check a returning player but still allowing that user to submit? I hide my custom warning div at start and displays it if 'remote' triggers. #2 How can I hide that div if the user change its name? Here is my script, thanks a lot for your advices : $(document).ready(function(){ $(#alreadyplayed).hide(); // this is my div warning telling you that you have already played $(#formQuiz).validate({ rules: { name: { required: true, remote: { url: scripts/namecheck.php, // checks if 'name' has already played type: post } } }, messages: { name: { required: required, remote: function(){ $(#alreadyplayed).show(); // displays my custom div warning return You already played! // display the regular 'remote' error message } } }, submitHandler: function(form) { form.submit(); } }); });
[jQuery] Re: Sort options in select.
On Jan 18, 3:52 am, NMarcu marcu.nico...@gmail.com wrote: What's the best way to sort options in select. I found a jquery plugin sortOptions(), but if I have options: Address 1, Address 2, Address 3, Address 100, Address 200 , will be sort like this: Address 1, Address 100, Address 2, Address 200, Address 3 ...and is not good. Do you have another solution, or how can I adapt this one to do a good sorting. If this is the sortOptions from http://www.texotela.co.uk/code/jquery/select/ you should be able to modify this yourself, and perhaps submit a patch back to the creator. Ideally, it would follow this pattern: $.fn.sortOptions = function(ascending, params) { var parameters = $.extend( {}, $.fn.sortOptions .defaults, params || {}); // [ ... ] // sort items in array sA.sort(parameters.sortFn); // [ ... ] }; $.fn.sortOptions.defaults = { sortFn: function(01, 02) { // original sort algorithm here } } That would be the only changes needed to the original plug-in. Then you could use it by either overriding jQuery.sortOptions.defaults.sortFn or by passing in your function to the call like this: $(selector).sortOptions(true, {sortFn: mySortFn}); You might want to do some additional work to allow the first parameter to sortOptions to remain optional. As to actually implementing your sort, I leave that to you Good luck, -- Scott
[jQuery] Re: Select part of text and add a CSS class
On Jan 18, 4:55 pm, Scott Sauyet scott.sau...@gmail.com wrote: pIt's a strongvery /strong typo: strongdifficult /strong -- Scott
[jQuery] Re: $.ajax call doesn't complete on 400 bad request response
I see now I misunderstood the complete functionality of JSONP, no XMLHttpRequest is made at all, and as a result it's not possible to control HTTP headers. In my case a script like: script type=text/javascript src=http://localhost:9998/search/jonas? callback=jsonp1263842210822 /script is injected and and loaded by the browser. Is there a way to check whether this is loaded at all? I guess the browser will not evaluate it if the server returns an error-code. As far as I can see an $.ajax( call which uses JSONP functionality will never call the error function. This would mean that the option to use would be to implement custom error handling at the service with messages and HTTP status code 200. -- Anton On Jan 18, 8:26 pm, anton anton.johans...@gmail.com wrote: A type, sorry, everything works fine without javascript warnings or errors, can seem to get any function to be called after a request which return 400. Just fixed the server so that it returns correct MIME-type application/javascript instead of just text for errors, this wasn't the problem though... $.ajax({ url: http://localhost:9998/search/; + searchVal + ? callback=?, type: GET, dataType: json, success: function() { alert(success); }, error: function() { alert(error); }, complete: function() { alert(complete); } }); Some Firebug info after a call: === GEThttp://localhost:9998/search/jonas?callback=jsonp1263842210822400 Bad Request localhost:9998 Response Headers: Server grizzly/1.9.9 Content-Type application/javascript Transfer-Encoding chunked Date Mon, 18 Jan 2010 19:17:15 GMT Connection close Response = jsonp1263842210822({msg:[LDAP: error code 4 - Sizelimit Exceeded]}) I also find it strange that request is made with Accept Header = */* instead of application/json which is stated as dataType but should maybe be discussed in another topic... have tried using dataType : jsonp and skipped the callback info in url, this gives the exact same result though. On Jan 18, 7:09 pm, Nathan Klatt n8kl...@gmail.com wrote: On Mon, Jan 18, 2010 at 11:05 AM, anton anton.johans...@gmail.com wrote: Can't seem to get any response from an ajax call which response is 400 Bad Request $.ajax({ url: url type: GET, Hey, is that missing comma after url a typo? Nathan
Re: [jQuery] Re: Superfish - Arrows don't display on dropdown
without seeing a link it sounds like path problems. Use firebug Net tab to see if everything is loading initialsbr wrote: Also, it appears that the menu works fine on the home page but not on any of the individual pages. Any suggestions there? On Jan 17, 7:57pm, initialsbr luke.kirkl...@gmail.com wrote: I'm really excited to use this bu the arrows aren't displaying on my menu. Here's the code I've got in the head... link rel="stylesheet" type="text/css" media="screen" href="" / script type="text/_javascript_" src=""/ script script type="text/_javascript_" src=""/script script type="text/_javascript_" src=""/script script type="text/_javascript_" $(document).ready(function(){ $("ul.sf-menu").supersubs({ minWidth: 12, maxWidth: 27, extraWidth: 1, autoArrows: true, }).superfish(); }); /script Here's what I've got in the body... div id="menu" ul class="sf-menu" li class="current" a href="" class="moz-txt-link-rfc2396E" href="http://localhost:/claykirkland/">"http://localhost:/claykirkland/"home/a /li li a href="" class="moz-txt-link-rfc2396E" href="http://localhost:/claykirkland/bio/">"http://localhost:/claykirkland/bio/"bio/a ul lia href=""musical/a/li lia href=""personal/a/li /ul /li li class="current" a href="" class="moz-txt-link-rfc2396E" href="http://localhost:/claykirkland/events/">"http://localhost:/claykirkland/events/"events/a /li li class="current" a href="" class="moz-txt-link-rfc2396E" href="http://localhost:/claykirkland/music/">"http://localhost:/claykirkland/music/"music/a /li li class="current" a href="" class="moz-txt-link-rfc2396E" href="http://localhost:/claykirkland/photos/">"http://localhost:/claykirkland/photos/"photos/a /li li a href="" class="moz-txt-link-rfc2396E" href="http://localhost:/claykirkland/bio/">"http://localhost:/claykirkland/bio/"shop/a ul lia href=""checkout/a/li lia href=""menu item/a/li /ul /li /ul /div In the css I show that the images at... http://localhost:/claykirkland/superfish/images/ I'm building this using MAMP and Wordpress on my computer. I don't get it. Everything else works great. Help!
[jQuery] Re: Drive jQuery plugin: a new kind of DOM builder
Hi Kevin, Thanks a lot for your suggestion. If you say that it would improve performance, I can try this way of inserting missing elements with a single 'append'. Also, do not hesitate if you have any other recommendation or comment. -Laurent On Jan 17, 11:58 am, Kevin Dalman kevin.dal...@gmail.com wrote: Interesting plug-in. I do a lot of DOM manipulation so am always interested in new ideas. I am particularly interested in optimizing the speed of generating and appending new elements. I had a quick peak at the source code and it appears each element is appended to the DOM one-by-one. Would it not provide better performance if ALL missing, and by definition 'nested', elements were created and then added to the DOM with a single 'append'? This is not the best place to discuss this, but I didn't want to take the time to create an account to add it to Git-Hub. /Kevin On Jan 15, 10:39 am, lfortin laurent.for...@gmail.com wrote: Hi all, I have recently released a beta version of my new plugin, the Drive jQuery plugin. This plugin is a new kind of DOM builder: it allows you to construct the DOM using basic jQuery selectors. It searches for elements, and if none is found, it attempts to create them. For example, assuming a default element tag = 'div': $('#element1 #element2.class1 span#element3.class2 img').drive ( ); is the equivalent of: $('#element1').append( $('div id=element2 /') .addClass('class1') .append( $('span id=element3 /') .addClass('class2') .append($('img /')) ) ); I need people to try and test my plugin :-) If you are interested, here is the repository on Github:http://github.com/lfortin/drive-jquery-plugin Downloads page:http://github.com/lfortin/drive-jquery-plugin/downloads Documentation:http://wiki.github.com/lfortin/drive-jquery-plugin/ If you encounter any bug or weird behavior, or if you have any comment, please reply to this post! Thank you for your help in advance, -Laurent
[jQuery] Animation for cloned elements
Hi All, I am trying to clone an element and add it with some animation efects. something like $item.clone(true).appendTo($list).slideDown(slow); It adds an element correctly, but I cannot get any effects working (tried fadeIn etc). What am i doing wrong? Thanks
[jQuery] Mixing jsTree with jqueryUI draggable and droppable
I'm trying to create a tight integration between two trees and a 'desktop' on which are floating elements (cards). I need to be able to: * drag and drop a tree node to the 'desktop' to 'open' the card that the node represents * drop a tree node onto an open card in order to create a relationship between them * drop an open card onto a tree node (also creates a relationship) * drop either an open card or a tree node anywhere on the 'tree' object that is not otherwise a drop target in order to effectively drop the card on the 'root' node of the tree (because 1.0 is not out yet, I'm using 0.9.9a of jsTree) I added droppable to my desktop element, but no event fires when I drop a tree node onto it. What is the correct way of telling when a tree node is dropped on something outside the tree? Does the helper need to have the ui-draggable class in order to work with a droppable, or is there more to it? I also added a call to the tree's drop_mode inside the draggable's .start() event. I can't see any evidence that it did anything, other than I know the call was made: $.tree.drop_mode({type:X}). Now, when I drag around a card, it drags the original element, so it is possible that the mouse events are being received by the card element, and never making it to the tree. But the drag-and-drop behavior of the card is exactly what I want, the card is semi-transparent so I can see what I am dropping it on. Items set as drop points using 'droppable' work fine, but the tree does not. What is the correct way of working with the tree and 'draggable' objects? Also, draggable objects support a 'revert' animation. I'd like to be able to revert the dropped card if I am holding the meta key, and close the open card if I am not. That is a question for the jQuery UI team, I suppose, but I'm asking it here, too, in case you happen to know the answer. Another thing I want is to have the default behavior differ depending on whether or not I am dragging-and-dropping within a tree, or between trees. Within a tree, I want the default action to be a 'move'. Between trees, I want it to be a 'copy'. Looking at the source, it looks like it won't work that way. Am I understanding what I am reading correctly? Is there a way to simulate it? Or do I need to add a feature to the tree code in order to get that behavior? -- John Arrowwood John (at) Irie (dash) Inc (dot) com John (at) Arrowwood Photography (dot) com John (at) Hanlons Razor (dot) com -- http://www.irie-inc.com/ http://arrowwood.blogspot.com/
Re: [jQuery] Animation for cloned elements
Is the item you are cloning already visible? If so, there is nothing for 'slideDown' to do. After you clone, but before you append, make it so that it is not visible (by whatever means is most appropriate), and see if that solves the problem. On Mon, Jan 18, 2010 at 3:28 PM, Andy789 e...@abcstudio.com.au wrote: Hi All, I am trying to clone an element and add it with some animation efects. something like $item.clone(true).appendTo($list).slideDown(slow); It adds an element correctly, but I cannot get any effects working (tried fadeIn etc). What am i doing wrong? Thanks -- John Arrowwood John (at) Irie (dash) Inc (dot) com John (at) Arrowwood Photography (dot) com John (at) Hanlons Razor (dot) com -- http://www.irie-inc.com/ http://arrowwood.blogspot.com/
[jQuery] Re: click action effect/problem
Thanks guys!
[jQuery] Re: click action effect/problem
I'd like to thank you guys again for the quick response, but for some reason, both methods aren't working. With the first method, when you click on the containing div, in this case #twitter, it reveals the div with the content, #flwtwitter. However, when you click on it a second time it tries to minimize, but does it horizontally, and then stops. It never really hides again. It jumps a bit also. Maybe this'll help: $(#twitter).click(function(e) { var $tgt = $(d.target); if ($tgt.is(#flwtwitter)) { return false; } if($(this).find(#flwtwitter).is(':hidden') { $(this).animate( { width: 248px }, 100, function() { $(this).find(#flwtwitter).fadeIn(fast); } ); } else if ($(this).find(#flwtwitter).is(':visible')) { $(this).find(#flwtwitter).fadeOut(fast, function() { $(this).animate( { width: 120px }, 300) } ); } }); I also tried the second method, and when clicking on the containing div, nothing happens. This is the same section of the jquery code with the second method: $(#twitter).click(function(event) { if (event.target.id != #flwtwitter) return; if ($(#flwtwitter).is(':hidden'))//if quick menu isn't visible { $(#twitter).animate( //show menu on click { width: 248px }, 100, function() { $(#flwtwitter).fadeIn(fast); } ); } else if ($(#flwtwitter).is(':visible')) //if quick menu is visible { $(#flwtwitter).fadeOut(fast, function() { $(#twitter).animate( { width: 120px }, 300) } ); //hide menu on click } });
[jQuery] jQuery 1.4 upgrade + env.rhino.js + blue-ridge
We'd like to move to jQuery 1.4 but we're being held up by compatibility issues in our javascript spec suite. The specs use the blue-ridge framework which leverages jQuery, Screw.Unit and env.rhino.js to run enable them to run on command line. As far as I can tell, Blue Ridge uses Envjs to set the window context from a spec file and triggers the load event on $(window) to initialize the callback to the Screw.Unit suite. When we load jQuery-1.3.2 to the environment, the tests run as expected. Running the suite with jQuery-1.4 in the browser also behaves as expected. When running the suite on the command line (Rhino) with jQuery-1.4, window event does not fire and the tests fail to run at all. Debugging reveals the window object appears to be null altogether. Without having dug too far into the new jQuery code and env.rhino.js, there appear to be some compatability issues between the two where certain calls to $(selector) do not behave as expected in the Rhino environment. Anyone else reporting issues? Ideas for follow up?
[jQuery] Re: Validation on a Modal form does not work
We have a similar problem. When trying to validate the modal dialog box decides its tired and goes away. Not sure how to do validation on the form without it disappearing... On Jan 7, 10:39 am, Elan Noy elan...@gmail.com wrote: I have amodalform that I want to validate. Themodalis based on the simplemodalplugin and thevalidationis based onvalidationplugin. Thevalidationworks well on a regular (nonmodal) form. ANy ideas? script type=text/javascript jQuery.validator.addMethod(zip, function(value, element) { return this.optional(element) || value.match(/^((\d{5}- \d{4})|(\d{5})|([a-z]\d[a-z]\s?\d[a-z]\d))$/i); }, US or Canadian postal code only); $(document).ready(function(){ getaddressBook(); $(#addAddress).validate({ rules: { emzip: { required: true, zip: true, }, }, }); }); /script
[jQuery] Re: UI dialog uses old data
I'm assuming you are submitting via $.ajax() .post. I ran into this same problem, even using dialog('destroy'). What I found is, you do destory the dialog, yet the form seems to remain in memory resulting in two of the same forms submitting. I spent 3 days trying to figure this out but here is the solution I found: $.ajax({ type: post, url: form.processor.php, dataType: json, data: form_data, success: function(data){ $(#tscreen_form).remove(); // remove the form $(#dialog)('destroy'); // remove the dialog div }. Hope that helps! On Dec 14 2009, 8:36 am, ebru...@gmail.com ebru...@gmail.com wrote: Then i think the problem is unique fields. Thanks for your reply! On 14 dec, 14:47, MorningZ morni...@gmail.com wrote: For some reason he rembers the old data It's not remembering anything, it's simply reading the values again... after you do your save/edit/whatever, use .val() and other things that set form field values and clear out what is there
Re: [jQuery] JQuery and AJAX Heartbeat question
Put this near the top of your PHP script: set_time_limit(0); The expected value is integer seconds. A value of 0 disables the time limit altogether. On Mon, Jan 18, 2010 at 4:25 PM, mind01 mindproduction...@gmail.com wrote: Hi there, I have a PHP script called zip.php to generate a zip file. This requires more than 30 seconds so my server give me an server error 500 time-out. Can i avoid this 500 error with JQuery and AJAX heartbeat? Greetz
Re: [jQuery] Re: Validation on a Modal form does not work
On Jan 7, 10:39 am, Elan Noy elan...@gmail.com wrote: I have amodalform that I want to validate. Themodalis based on the simplemodalplugin and thevalidationis based onvalidationplugin. Thevalidationworks well on a regular (nonmodal) form. ANy ideas? script type=text/javascript jQuery.validator.addMethod(zip, function(value, element) { return this.optional(element) || value.match(/^((\d{5}- \d{4})|(\d{5})|([a-z]\d[a-z]\s?\d[a-z]\d))$/i); }, US or Canadian postal code only); $(document).ready(function(){ getaddressBook(); $(#addAddress).validate({ Could it be simply that the document is already ready so your ready function is not being called? Try executing the contents of the ready function inline? Nathan
[jQuery] Simple .html problem in 1.4
Hi folks, The following function works fine in jQ1.3, but not in jQ1.4 function getArchive(pID){ $.get(scripts/ajax_editor.asp?id=getArcepID=+pID+q= + new Date().getTime(), function(responseText){ //console.log(responseText); $('#archive').html(responseText).show(); }); $('#archiveOn').hide();$('#archiveOff').show(5); }; In both instances, the responseText is returned, but whereas it is injected into the div 'archive' and displayed when using jQ1.3, nothing happens when 1.4 is used. Any idea of where I should be looking for a solution? Thanks, Bruce
Re: [jQuery] After donating how do I download a book title?
My apologies, I'm sure that was not on there when I made the donation as I did read the whole page. -Brett 2010/1/17 Nicolai Constantin Reuschling codeblog...@gmail.com Brett, have you even read the website: http://jquery14.com/donate The jQuery Project will send you an email with instructions for downloading your e-book. Please do not contact the conservancy regarding your book. E-books will be distributed starting on Tuesday, Jan 19th. Regards, Nicolai