[jQuery] (validate) Using metadata attr type with validate plugin
Hi there, We managed to get the validation plugin to work with metadata inside a class attribute, but we would like to move it to its own HTML5 data- xxx attribute. Our current efforts look like this: $.metadata.setType( attr, data ); $(#commentForm).validate({meta: data}); with the HTML: input id=cname name=name maxlength=5 minlength=2 required=* data={messages:{required:'Enter this!',minlength:'Too short!'}}/ (we only want to put messages in there) But this does not work. What are we doing wrong? Or, how can we tell validate to use attr method for metadata? (The following does work:) input id=cname name=name maxlength=5 minlength=2 required=* class={messages:{required:'Enter this!',minlength:'Too short!'}}/ Regards - Iwan
[jQuery] Re: (validate) Using metadata attr type with validate plugin
On Nov 10, 11:29 am, Iwan Vosloo i...@reahl.org wrote: (The following does work:) input id=cname name=name maxlength=5 minlength=2 required=* class={messages:{required:'Enter this!',minlength:'Too short!'}}/ Oops, that should have read: input id=cname name=name maxlength=5 minlength=2 required=* class={data:{messages:{required:'Enter this!',minlength:'Too short!'}}}/ -i
[jQuery] Load image with an ajax preloader?
How do i make this work? $(#color_update).change(function(){ var src = $(option:selected, this).val() ; var src2 = $(#quantity_update option:selected).text(); $('#imagePreview').html('pdiv id=ajaxLoader align=center img src=ajax-loader.gif width=32 height=32 //div/p'); $('#imagePreview').load('img src='+src+-+src2+'.jpg/'); alert(src+-+src2+.jpg); });
Re: [jQuery] Load image with an ajax preloader?
http://docs.jquery.com/Ajax/loadApparently you're confusing .load()http://docs.jquery.com/Ajax/loadand .html() http://docs.jquery.com/Attributes/html. The first is used to make an AJAX call, bring back an html document, possibly hack a part, and fill a portion of your page with the content obtained, whereas what you want is simply to put a new img / tag. Funny thing is you're already doing it properly the line before the .load(). So, what you need here is indeed to .html() your new img in a container, and what you want is to have a preload image in the background while the image is loading. Well, if I were you, I'd simply set a background in the container, through a css rule so that it always displays and will be behind the image when it's finished loading. So, how do we do that ? In a CSS file : #imagePreview { background: url(/ajax-loader.gif) center no-repeat; } In a JS file : $(#color_update).change(function() { ... $('#imagePreview').html('img src='+src+-+src2+'.jpg/'); ... }); This should work a treat provided your ajax-loader.gif is accessible via the root of your site. Michel Belleville
[jQuery] build menu on a 'event' location ?
I would like to build a popup menu at/above the location of an img .. element. Using $(img).hover could start it, but I'm not sure if JQ has to ability to build a whole popup menu at that place the img .. is located. Any ideas/pointers?
[jQuery] JQuery validation plugin - error highlight problem
I have a form with two input textboxes, and I have included JQuery validation rules for both: script src=../../Scripts/jquery-validate/jquery.validate.js type=text/javascript/script script type=text/javascript $(document).ready(function() { $('#respondForm').validate({ onclick: false, onkeyup: false, onfocusout: false, highlight: function(element, errorClass) { $(element).css({ backgroundColor: 'Red' }); } , errorLabelContainer: $(ul, $('div.error-container')), wrapper: 'li', rules: { 'text': { required: true , minlength: 5 , maxlength: 10 }, integer: { required: true, range: [0, 90] } } , messages: { 'text': { required: xxx_Required , minlength: XXX Should be greater than 5 , maxlength: XXX Cannot be greater than 10 }, integer: { required: is required, range: is out of range: [0,90] } } }); }); /script /head . . . input type=text id=text name=text / br / input type=text id=integer name=integer / br / input type=submit name=submit value=Submit / br / I have used: function(element, errorClass) { $(element).css({ backgroundColor: 'Red' }); } to highlight the error control. Now the problem is that in the following scenario, both the input textboxes remain highlighted (background color: red): 1. Input text with less than 5 characters in text box 1 2. Leave text box 2 blank 3. Hit submit 4. Both input text box background will be changed to red (which is correct) 5. Now enter a text which has 6 characters in text box 1(valid input) 6. Leave text box 2 empty 7. Hit submit 8. The background color for both the textboxes remains red. Where as the expectation is that the background color of text box 1 should not be red How do i resolve this problem? -- View this message in context: http://old.nabble.com/JQuery-validation-plugin---error-highlight-problem-tp26282040s27240p26282040.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Refreshing Problem
Does noone have a solution to this...? Hey guys, I'm working on a status-Updater. It works, there is just one problem, after sending a Status I have to manual reload the page to let the script work again. Do you can help me please? Here's the code: script language=javascript $(document).ready(function(){ $(form#status_form).submit(function(){ var s_autor = $('#s_autor').attr('value'); var s_status= $('#s_status').attr('value'); $.ajax({ type: POST, url: /admin/request.php, data: s_autor=+ s_autor + s_status=+ s_status, success: function(){ $('#show').load(/admin/request.php).fadeIn (slow, function(){ setTimeout(function(){ $(function() { $(#show).fadeTo (slow, 0.01, function(){ $ (this).slideUp(slow, function() { $ (this).remove(); }); }); }); }, 2000); }); }, }); return false; }); }); /script So do you know how to code it to make it possible to repeat the script how often I click on the submit button? By the way, here's the HTML-Form: form id=status_form method=post action=request.php onsubmit=return false; input type=text id=s_autor name=s_autor value=?= $user_id; ? style=display: none; /input type=text id=s_status name=s_status value=Statusnachricht /input type=submit value= class=submit id=status_submit / /form Well, the file request.php is looking like this (in the moment!): div class=inhaltdiv class=textErfolgreich eingetragen!/div/ div The PHP-Part is coming up. I want to reach that if I click on the submit-Button, the jquery-code works. Well, it works, but just ONE TIME. After clicking the first time on the submit-button, the script SHOULD work like it did the first time. But if I click on the submit button the second time, nothing works. Anyway: I want the script work as often I click on the submit button Hope you understand me. My english is not the best... (I'm german...)
[jQuery] superfish menu not working with plugins that use jquery
Hello. I have installed a theme that uses superfish jquery dropdown menu. all worked well but when enabling the plugins: mailpress or wp-news- ticker, the superfish menu broke. I think it might be a relative small problem but I don't know anything about scripts. here is the site with the news-ticker plugin enabled: http://www.emetaheret.org.il/test has anyone used another jquery plugin with the menu? help would be greatly appreciated. thanks
[jQuery] Selection logic
Hello, I'm using jQuery but am not really used to it (Mootools' user here...). I was trying to add a class to the first parent div of an element. Here is how I proceeded in the first place : - $(el).parent('div'); // Doesn't return anything: why? My second attempt was better (intermediate steps for better comprehension): - $(el).parents('div'); // Returns all parent div, cool but I only need the first: - ($el).parents('div').get(0); // Returns the div I want: yeah again! - $(el).parents('div').get(0).addClass('myClass'); // Doesn't work: why? Finally my last attempt (I asked for help) was the good one: - $(el).parents('div:first').addClass('myClass'); // Works fine I was expecting all of the 3 methods to work, but that's not really what's happening: kind of frustating! Can someone explain me why, so I become efficient with jQuery? Thank you in advance for the provided help. Sincerely, Savageman.
[jQuery] Retrieving the URL used in a getJSON call in an error function?
Hi folks, Is it possible to retrieve the URL used in a getJSON call in a generic ajax error handler? I do the following: jQuery.ajaxSetup({ error: showAjaxError }); with the function being: function showAjaxError(XMLHttpRequest, textStatus, errorThrown) {} ...and all our calls use getJSON i.e. jQuery.getJSON(/resources/javascript/gettingstarted.json, function (data) {} But I can't figure out how to get the requested URL in the ajax error function? Is it possible? Many thanks! Paul.
[jQuery] (validate) Change Framework to Select from Classes attached to Table Elements
I have a special application that I am trying to get the jQuery Validation Plugin to work. All the elements on my page are encased inside of a table, and I don't have the ability to apply classes directly to the validated elements (input, etc). The classes must come on the table elements: table tr td class=required input id=myinput/input /td /tr /table Either I need to be able to make a standard way to validate the entire form with all the standard out-of-the-box validators using the strict format listed above, or I need to change the plugin to work with my application. Which is easier, and how could I approach this? I've had some luck by manually attaching validation by using the following code: $(.required input).each(function() { $(this).rules(add, { required: true }); }); but, I would rather use the plugin instead of having to go through all the standard validations and manually applying them. It would also help for custom validations, as it will take less code to use the plugin methods directly. Any help is appreciated.
[jQuery] $ is not a function
Dear all, I'm trying to use Jquery with Website baker. In this CMS I added two modules (portfolio and magnify) that use jquery, and then it seems that they are in conflict. With firebug I have $ is not a function I already tried to add jQuery.noConflict(); in all the js loaded. But the same. I'm not a JS expert.. so if someone can help me ! Many thanks The error page : http://www.eco2system.net/pages/nos-realisations/eau-de-mer.php Thomas
Re: [jQuery] $ is not a function
try something like this var $myvar = jQuery.noConflict(); $myvar(function() { $myvar(body).animate({ opacity:0}, 500); }); On Tue, Nov 10, 2009 at 12:40 PM, tvidal vidal.tho...@gmail.com wrote: Dear all, I'm trying to use Jquery with Website baker. In this CMS I added two modules (portfolio and magnify) that use jquery, and then it seems that they are in conflict. With firebug I have $ is not a function I already tried to add jQuery.noConflict(); in all the js loaded. But the same. I'm not a JS expert.. so if someone can help me ! Many thanks The error page : http://www.eco2system.net/pages/nos-realisations/eau-de-mer.php Thomas
Re: [jQuery] Refreshing Problem
You can : 1. wrap the submit callback in a method and give it to eat to the form each time you receive it again 2. put the form somewhere else so it's not changed by the ajax call when you reload and the submit stays attached 3. use .livequery() http://docs.jquery.com/Plugins/livequery/livequery(sadly .live() doesn't work with submit events) As for me I'd rather use the 2nd method when possible because it's really simpler and requires less voodoo, the 3rd probably being the best in most complicated cases, and the 1st being simple as long as you don't have 2 or more criss-crossing ajax calls that may change the page in different ways. Hope it helps. Michel Belleville 2009/11/10 Dominik Kohlstruck o...@hotmail.de Does noone have a solution to this...? Hey guys, I'm working on a status-Updater. It works, there is just one problem, after sending a Status I have to manual reload the page to let the script work again. Do you can help me please? Here's the code: script language=javascript $(document).ready(function(){ $(form#status_form).submit(function(){ var s_autor = $('#s_autor').attr('value'); var s_status= $('#s_status').attr('value'); $.ajax({ type: POST, url: /admin/request.php, data: s_autor=+ s_autor + s_status=+ s_status, success: function(){ $('#show').load(/admin/request.php).fadeIn (slow, function(){ setTimeout(function(){ $(function() { $(#show).fadeTo (slow, 0.01, function(){ $ (this).slideUp(slow, function() { $ (this).remove(); }); }); }); }, 2000); }); }, }); return false; }); }); /script So do you know how to code it to make it possible to repeat the script how often I click on the submit button? By the way, here's the HTML-Form: form id=status_form method=post action=request.php onsubmit=return false; input type=text id=s_autor name=s_autor value=?= $user_id; ? style=display: none; /input type=text id=s_status name=s_status value=Statusnachricht /input type=submit value= class=submit id=status_submit / /form Well, the file request.php is looking like this (in the moment!): div class=inhaltdiv class=textErfolgreich eingetragen!/div/ div The PHP-Part is coming up. I want to reach that if I click on the submit-Button, the jquery-code works. Well, it works, but just ONE TIME. After clicking the first time on the submit-button, the script SHOULD work like it did the first time. But if I click on the submit button the second time, nothing works. Anyway: I want the script work as often I click on the submit button Hope you understand me. My english is not the best... (I'm german...)
Re: [jQuery] Selection logic
var parent_element = $(.child).parents('div'); On Tue, Nov 10, 2009 at 12:16 PM, Savageman savagema...@gmail.com wrote: Hello, I'm using jQuery but am not really used to it (Mootools' user here...). I was trying to add a class to the first parent div of an element. Here is how I proceeded in the first place : - $(el).parent('div'); // Doesn't return anything: why? My second attempt was better (intermediate steps for better comprehension): - $(el).parents('div'); // Returns all parent div, cool but I only need the first: - ($el).parents('div').get(0); // Returns the div I want: yeah again! - $(el).parents('div').get(0).addClass('myClass'); // Doesn't work: why? Finally my last attempt (I asked for help) was the good one: - $(el).parents('div:first').addClass('myClass'); // Works fine I was expecting all of the 3 methods to work, but that's not really what's happening: kind of frustating! Can someone explain me why, so I become efficient with jQuery? Thank you in advance for the provided help. Sincerely, Savageman.
Re: [jQuery] build menu on a 'event' location ?
Yes it probably can, depending on what exactly you'd like to do with it. Could you be a little bit more specific please ? Michel Belleville 2009/11/10 neandr gnea...@googlemail.com I would like to build a popup menu at/above the location of an img .. element. Using $(img).hover could start it, but I'm not sure if JQ has to ability to build a whole popup menu at that place the img .. is located. Any ideas/pointers?
Re: [jQuery] build menu on a 'event' location ?
As for locating the element, you can use .offset()http://docs.jquery.com/CSS/offsetto get its coordinates in the document and .position() http://docs.jquery.com/CSS/position for its position relative to the offset parent (which can be accessed by .offsetParent()http://docs.jquery.com/Traversing/offsetParent). After that it's just a matter of adding an element at the right position relatively to the right parent (through css for example). Michel Belleville 2009/11/10 Michel Belleville michel.bellevi...@gmail.com Yes it probably can, depending on what exactly you'd like to do with it. Could you be a little bit more specific please ? Michel Belleville 2009/11/10 neandr gnea...@googlemail.com I would like to build a popup menu at/above the location of an img .. element. Using $(img).hover could start it, but I'm not sure if JQ has to ability to build a whole popup menu at that place the img .. is located. Any ideas/pointers?
Re: [jQuery] Selection logic
- $(el).parent('div'); // didn't work because .parent()http://docs.jquery.com/Traversing/parent(only matches the direct parent, not any ancestors) is not the same as .parents() http://docs.jquery.com/Traversing/parents (matches all ancestors) - $(el).parents('div'); // returning all matching ancestors is the point indeed - $(el).parents('div').get(0).addClass('myClass'); // should work, may be a testing error (just tested it, worked for me) Anyway, continue to try things and you'll be efficient with jQuery, don't worry. Coming from another framework and re-learning the lingo is just a phase, it's frustrating but it's worth it. And jQuery may be an acquired taste but it's great once you're used to it. Michel Belleville 2009/11/10 waseem sabjee waseemsab...@gmail.com var parent_element = $(.child).parents('div'); On Tue, Nov 10, 2009 at 12:16 PM, Savageman savagema...@gmail.com wrote: Hello, I'm using jQuery but am not really used to it (Mootools' user here...). I was trying to add a class to the first parent div of an element. Here is how I proceeded in the first place : - $(el).parent('div'); // Doesn't return anything: why? My second attempt was better (intermediate steps for better comprehension): - $(el).parents('div'); // Returns all parent div, cool but I only need the first: - ($el).parents('div').get(0); // Returns the div I want: yeah again! - $(el).parents('div').get(0).addClass('myClass'); // Doesn't work: why? Finally my last attempt (I asked for help) was the good one: - $(el).parents('div:first').addClass('myClass'); // Works fine I was expecting all of the 3 methods to work, but that's not really what's happening: kind of frustating! Can someone explain me why, so I become efficient with jQuery? Thank you in advance for the provided help. Sincerely, Savageman.
Re: [jQuery] Retrieving the URL used in a getJSON call in an error function?
I didn't have to do that for now, but if I had to I'd use Firebug to inspect XMLHttpRequest in the dom view and see if there's an url, target, or location property or method that returns something looking like said url. Once you've installed Firebug (which is a great tool to debug JavaScript (especially AJAX, but also html, css, etc)) you can add to your error callback : console.log(XMLHttpRequest); This will output in Firebug's console the content of XMLHttpRequest. You can then right-click on it and select view in DOM tab in the contextual menu. You'll get the view you need to inspect it from the inside and find what you need. Hope this helps. Michel Belleville 2009/11/10 paul s pksole...@gmail.com Hi folks, Is it possible to retrieve the URL used in a getJSON call in a generic ajax error handler? I do the following: jQuery.ajaxSetup({ error: showAjaxError }); with the function being: function showAjaxError(XMLHttpRequest, textStatus, errorThrown) {} ...and all our calls use getJSON i.e. jQuery.getJSON(/resources/javascript/gettingstarted.json, function (data) {} But I can't figure out how to get the requested URL in the ajax error function? Is it possible? Many thanks! Paul.
RE: [jQuery] build menu on a 'event' location ?
I wasn’t familiar with .offsetParent()…good stuff to know, Michel! Rick From: Michel Belleville [mailto:michel.bellevi...@gmail.com] Sent: Tuesday, November 10, 2009 7:46 AM To: jquery-en@googlegroups.com Subject: Re: [jQuery] build menu on a 'event' location ? As for locating the element, you can use .offset() http://docs.jquery.com/CSS/offset to get its coordinates in the document and .position() http://docs.jquery.com/CSS/position for its position relative to the offset parent (which can be accessed by .offsetParent() http://docs.jquery.com/Traversing/offsetParent ). After that it's just a matter of adding an element at the right position relatively to the right parent (through css for example). Michel Belleville 2009/11/10 Michel Belleville michel.bellevi...@gmail.com Yes it probably can, depending on what exactly you'd like to do with it. Could you be a little bit more specific please ? Michel Belleville 2009/11/10 neandr gnea...@googlemail.com I would like to build a popup menu at/above the location of an img .. element. Using $(img).hover could start it, but I'm not sure if JQ has to ability to build a whole popup menu at that place the img .. is located. Any ideas/pointers?
[jQuery] Share link in ajax.
Hi all, I have a Share(share this) link in a page . If I call this page using ajax then share link was missing. But if i run this page directly, It works perfectly. Can any body tell me why this happen. Thanks in advance
Re: [jQuery] Share link in ajax.
Without any code nor indication on how your Share link was added to your page that's a really tricky one, so here's my shot in the dark : Your Share link was added to your page using a script that was loaded through a script tag in the head of your document. When you're loading your page through AJAX, you're just not triggering it. For a more precise diagnosis, please post details on your system. Michel Belleville 2009/11/10 Rupak rupakn...@gmail.com Hi all, I have a Share(share this) link in a page . If I call this page using ajax then share link was missing. But if i run this page directly, It works perfectly. Can any body tell me why this happen. Thanks in advance
[jQuery] Re: $ is not a function
Dear sabjee I tried : var $toto = jQuery.noConflict(); $toto(function() { $toto(body).animate({ opacity:0}, 500); }) And I have the same error and one more : $toto(function () {$toto (body).animate({opacity: 0}, 500);}) is not a function Do I need to put the function into the main fancy function (http:// www.eco2system.net/modules/portfolio/script/jquery.fancybox.js) ? Many thanks Regards Thomas On 10 nov, 13:37, waseem sabjee waseemsab...@gmail.com wrote: try something like this var $myvar = jQuery.noConflict(); $myvar(function() { $myvar(body).animate({ opacity:0}, 500); }); On Tue, Nov 10, 2009 at 12:40 PM, tvidal vidal.tho...@gmail.com wrote: Dear all, I'm trying to use Jquery with Website baker. In this CMS I added two modules (portfolio and magnify) that use jquery, and then it seems that they are in conflict. With firebug I have $ is not a function I already tried to add jQuery.noConflict(); in all the js loaded. But the same. I'm not a JS expert.. so if someone can help me ! Many thanks The error page : http://www.eco2system.net/pages/nos-realisations/eau-de-mer.php Thomas
Re: [jQuery] Re: $ is not a function
I have just cheked your error page and my script worked out as expected. within 0.5 seconds all the html fades out. this is on firefox 3.5 however i did note 2 errors which are as you stated I also noted you are using quite a lot of scripts on your page. and your scripts are not defined in your head area try moving your scripts to your head area also i take it the $ is not a function error only started coming up once you used jQuery.noConflict() can you try removing your noconflicts if you are using jQuery only noconflict would not be needed unless you have two plugins with similar function names. trying doing the above mentioned and let me know when you have - I will check your test page again :) you can remove the fade out animation :) On Tue, Nov 10, 2009 at 3:22 PM, tvidal vidal.tho...@gmail.com wrote: Dear sabjee I tried : var $toto = jQuery.noConflict(); $toto(function() { $toto(body).animate({ opacity:0}, 500); }) And I have the same error and one more : $toto(function () {$toto (body).animate({opacity: 0}, 500);}) is not a function Do I need to put the function into the main fancy function (http:// www.eco2system.net/modules/portfolio/script/jquery.fancybox.js) ? Many thanks Regards Thomas On 10 nov, 13:37, waseem sabjee waseemsab...@gmail.com wrote: try something like this var $myvar = jQuery.noConflict(); $myvar(function() { $myvar(body).animate({ opacity:0}, 500); }); On Tue, Nov 10, 2009 at 12:40 PM, tvidal vidal.tho...@gmail.com wrote: Dear all, I'm trying to use Jquery with Website baker. In this CMS I added two modules (portfolio and magnify) that use jquery, and then it seems that they are in conflict. With firebug I have $ is not a function I already tried to add jQuery.noConflict(); in all the js loaded. But the same. I'm not a JS expert.. so if someone can help me ! Many thanks The error page : http://www.eco2system.net/pages/nos-realisations/eau-de-mer.php Thomas
[jQuery] AJAX requests in progress
In prototype, I can find out how many AJAX requests have been made to the server but no response has yet been received by looking at: Ajax.activeRequestCount Is there a similar feature in jQuery? I realise I could make something myself by listening for the Ajax beforeSend and complete events, but it feels like there should be a simpler way. Ideally, I'm looking to be able to execute some code and find out if any ajax requests are outstanding without needing to set anything up before the call. I'm doing this so my testing framework can tell if the page is fully loaded - I don't really want to have to inject code into my application and potentially change its behaviour if I can avoid it. Alun Harford
[jQuery] SOAP Web Services
I am relatively new to jquery. I am looking to learn how to consume SOAP Java web services with Javascript, using jQuery. I may also need to consume JSON Java web services. Can anyone provide some good sample applications I can look at it to learn how to do this? I have read information about the SOAP client plugin, but I would really like to see example code which shows how to do this type of thing. Thanks Chuck
[jQuery] Ajax Load, CSS Insert on Loading Gif and Fade Out
Hello, I would like to add css through jquery to make a loading gif appear. Say in the css stylesheet itself, #vv is set without a width, so I was hoping to put a width on the css loading gif background image in jquery to make it appear. If this is not possible to do in jquery, then a style:non alternative and then making the css show in jquery would be fine. unfortunately I do not know how to do either of this in jquery or how to make the gif fade in and out. The concept syntax (non working) I had in mind is below. (Note: If wondering, I have 3 divs on my website to be loading in a slider, but only the first div needs to show the loading gif, the first slide) $(function(){ $(#first).empty().fadeIn(80)$('#vv').css('width:48px').fadeOut(500); $(#first).load(ahahpage.html #u); $(#second).load(ahahpage.html #k); $(#third).load(ahahpage.html #b); }); Thankyou
[jQuery] Re: $ is not a function
SO MANY THANKS !!! I just remove noConflict in magnify script (original one) and everything works !! So many thanks again ! I don't know since how many hours/days I'm working on !! All the best Thomas On 10 nov, 14:31, waseem sabjee waseemsab...@gmail.com wrote: I have just cheked your error page and my script worked out as expected. within 0.5 seconds all the html fades out. this is on firefox 3.5 however i did note 2 errors which are as you stated I also noted you are using quite a lot of scripts on your page. and your scripts are not defined in your head area try moving your scripts to your head area also i take it the $ is not a function error only started coming up once you used jQuery.noConflict() can you try removing your noconflicts if you are using jQuery only noconflict would not be needed unless you have two plugins with similar function names. trying doing the above mentioned and let me know when you have - I will check your test page again :) you can remove the fade out animation :) On Tue, Nov 10, 2009 at 3:22 PM, tvidal vidal.tho...@gmail.com wrote: Dear sabjee I tried : var $toto = jQuery.noConflict(); $toto(function() { $toto(body).animate({ opacity:0}, 500); }) And I have the same error and one more : $toto(function () {$toto (body).animate({opacity: 0}, 500);}) is not a function Do I need to put the function into the main fancy function (http:// www.eco2system.net/modules/portfolio/script/jquery.fancybox.js) ? Many thanks Regards Thomas On 10 nov, 13:37, waseem sabjee waseemsab...@gmail.com wrote: try something like this var $myvar = jQuery.noConflict(); $myvar(function() { $myvar(body).animate({ opacity:0}, 500); }); On Tue, Nov 10, 2009 at 12:40 PM, tvidal vidal.tho...@gmail.com wrote: Dear all, I'm trying to use Jquery with Website baker. In this CMS I added two modules (portfolio and magnify) that use jquery, and then it seems that they are in conflict. With firebug I have $ is not a function I already tried to add jQuery.noConflict(); in all the js loaded. But the same. I'm not a JS expert.. so if someone can help me ! Many thanks The error page : http://www.eco2system.net/pages/nos-realisations/eau-de-mer.php Thomas
[jQuery] Re: Selection logic
@waseem sabjee: Don't know what to think of your answer... I already figured to use .parents() without you... :) @Michel Belleville: Wow, thank you for that wonderful answer! ;) About .get(0), Firebug keeps telling me: $(el).parents(div).get (0).addClass is not a function I still find strange (that eventually gonna change :D) to add the possibility to match a specified selector in the .parent() method if it only applies to the direct parent... I don't really need all the parents here, so it may be more efficient having a method that stops looping through parents when the one we want is found. I guess I still can use .parent().parent().parent() as I know the div should be the third parent, but that would require change in the javacscript if i want to change the HTML structure... On 10 nov, 13:58, Michel Belleville michel.bellevi...@gmail.com wrote: - $(el).parent('div'); // didn't work because .parent()http://docs.jquery.com/Traversing/parent(only matches the direct parent, not any ancestors) is not the same as .parents() http://docs.jquery.com/Traversing/parents (matches all ancestors) - $(el).parents('div'); // returning all matching ancestors is the point indeed - $(el).parents('div').get(0).addClass('myClass'); // should work, may be a testing error (just tested it, worked for me) Anyway, continue to try things and you'll be efficient with jQuery, don't worry. Coming from another framework and re-learning the lingo is just a phase, it's frustrating but it's worth it. And jQuery may be an acquired taste but it's great once you're used to it. Michel Belleville 2009/11/10 waseem sabjee waseemsab...@gmail.com var parent_element = $(.child).parents('div'); On Tue, Nov 10, 2009 at 12:16 PM, Savageman savagema...@gmail.com wrote: Hello, I'm using jQuery but am not really used to it (Mootools' user here...). I was trying to add a class to the first parent div of an element. Here is how I proceeded in the first place : - $(el).parent('div'); // Doesn't return anything: why? My second attempt was better (intermediate steps for better comprehension): - $(el).parents('div'); // Returns all parent div, cool but I only need the first: - ($el).parents('div').get(0); // Returns the div I want: yeah again! - $(el).parents('div').get(0).addClass('myClass'); // Doesn't work: why? Finally my last attempt (I asked for help) was the good one: - $(el).parents('div:first').addClass('myClass'); // Works fine I was expecting all of the 3 methods to work, but that's not really what's happening: kind of frustating! Can someone explain me why, so I become efficient with jQuery? Thank you in advance for the provided help. Sincerely, Savageman.
Re: [jQuery] Re: $ is not a function
Yeah - it takes many days of headaches to make the rest of the days a little easier :) On Tue, Nov 10, 2009 at 3:45 PM, tvidal vidal.tho...@gmail.com wrote: SO MANY THANKS !!! I just remove noConflict in magnify script (original one) and everything works !! So many thanks again ! I don't know since how many hours/days I'm working on !! All the best Thomas On 10 nov, 14:31, waseem sabjee waseemsab...@gmail.com wrote: I have just cheked your error page and my script worked out as expected. within 0.5 seconds all the html fades out. this is on firefox 3.5 however i did note 2 errors which are as you stated I also noted you are using quite a lot of scripts on your page. and your scripts are not defined in your head area try moving your scripts to your head area also i take it the $ is not a function error only started coming up once you used jQuery.noConflict() can you try removing your noconflicts if you are using jQuery only noconflict would not be needed unless you have two plugins with similar function names. trying doing the above mentioned and let me know when you have - I will check your test page again :) you can remove the fade out animation :) On Tue, Nov 10, 2009 at 3:22 PM, tvidal vidal.tho...@gmail.com wrote: Dear sabjee I tried : var $toto = jQuery.noConflict(); $toto(function() { $toto(body).animate({ opacity:0}, 500); }) And I have the same error and one more : $toto(function () {$toto (body).animate({opacity: 0}, 500);}) is not a function Do I need to put the function into the main fancy function (http:// www.eco2system.net/modules/portfolio/script/jquery.fancybox.js) ? Many thanks Regards Thomas On 10 nov, 13:37, waseem sabjee waseemsab...@gmail.com wrote: try something like this var $myvar = jQuery.noConflict(); $myvar(function() { $myvar(body).animate({ opacity:0}, 500); }); On Tue, Nov 10, 2009 at 12:40 PM, tvidal vidal.tho...@gmail.com wrote: Dear all, I'm trying to use Jquery with Website baker. In this CMS I added two modules (portfolio and magnify) that use jquery, and then it seems that they are in conflict. With firebug I have $ is not a function I already tried to add jQuery.noConflict(); in all the js loaded. But the same. I'm not a JS expert.. so if someone can help me ! Many thanks The error page : http://www.eco2system.net/pages/nos-realisations/eau-de-mer.php Thomas
Re: [jQuery] Selection logic
On Nov 10, 2009, at 7:58 AM, Michel Belleville wrote: $(el).parents('div').get(0).addClass('myClass'); // should work, may be a testing error (just tested it, worked for me) Interesting that this one worked for you. I wouldn't expect it to, since the .get() method is supposed to return a DOM element (when an index is passed in), and addClass should only operate on the jQuery object. I would expect this to work: $(el).parents('div').eq(0).addClass('myClass'); and this: $(el).parents('div:eq(0)').addClass('myClass'); and this: $(el).parents('div:first').addClass('myClass'); and, in 1.4 (sneak peek!), this: $(el).parents('div').first().addClass('myClass'); --Karl Karl Swedberg www.englishrules.com www.learningjquery.com
[jQuery] Re: Retrieving the URL used in a getJSON call in an error function?
Cheers Michel, never thought of using Firebug to see what was available. I did try and decipher the W3Cs specifications but Firebug would be easier :) Paul. On Nov 10, 1:04 pm, Michel Belleville michel.bellevi...@gmail.com wrote: I didn't have to do that for now, but if I had to I'd use Firebug to inspect XMLHttpRequest in the dom view and see if there's an url, target, or location property or method that returns something looking like said url. Once you've installed Firebug (which is a great tool to debug JavaScript (especially AJAX, but also html, css, etc)) you can add to your error callback : console.log(XMLHttpRequest); This will output in Firebug's console the content of XMLHttpRequest. You can then right-click on it and select view in DOM tab in the contextual menu. You'll get the view you need to inspect it from the inside and find what you need. Hope this helps. Michel Belleville 2009/11/10 paul s pksole...@gmail.com Hi folks, Is it possible to retrieve the URL used in a getJSON call in a generic ajax error handler? I do the following: jQuery.ajaxSetup({ error: showAjaxError }); with the function being: function showAjaxError(XMLHttpRequest, textStatus, errorThrown) {} ...and all our calls use getJSON i.e. jQuery.getJSON(/resources/javascript/gettingstarted.json, function (data) {} But I can't figure out how to get the requested URL in the ajax error function? Is it possible? Many thanks! Paul.
Re: [jQuery] Re: Selection logic
2009/11/10 Savageman savagema...@gmail.com About .get(0), Firebug keeps telling me: $(el).parents(div).get (0).addClass is not a function Sorry, I tested with .eq(0) instead of .get(0) which returns the pure DOM element instead of a jQuery magic-array wrapping the element. I still find strange (that eventually gonna change :D) to add the possibility to match a specified selector in the .parent() method if it only applies to the direct parent... I don't really need all the parents here, so it may be more efficient having a method that stops looping through parents when the one we want is found. I guess I still can use .parent().parent().parent() as I know the div should be the third parent, but that would require change in the javacscript if i want to change the HTML structure... If you don't need all the parents, use .parents('div:first') or .parents('div').eq(0) as you've found out it's the jQuery way. I may even be so bold as to add you might like to try .closest()http://docs.jquery.com/Traversing/closestwhich is quite handy to find the closest matching element this included. Have fun. Michel Belleville
Re: [jQuery] Selection logic
2009/11/10 Karl Swedberg k...@englishrules.com On Nov 10, 2009, at 7:58 AM, Michel Belleville wrote: - $(el).parents('div').get(0).addClass('myClass'); // should work, may be a testing error (just tested it, worked for me) Interesting that this one worked for you. I wouldn't expect it to, since the .get() method is supposed to return a DOM element (when an index is passed in), and addClass should only operate on the jQuery object. Sorry, mistook .get() for .eq() wich is another thing altogether indeed (yeah, I should not rewrite when I test). Michel Belleville
[jQuery] Re: Selection logic
Maybe $($(el).parents('div').get(0)).addClass() ? :d (ahah, what ugly syntax :d) Anyway thanks, topic solved! ;) On 10 nov, 15:04, Michel Belleville michel.bellevi...@gmail.com wrote: 2009/11/10 Savageman savagema...@gmail.com About .get(0), Firebug keeps telling me: $(el).parents(div).get (0).addClass is not a function Sorry, I tested with .eq(0) instead of .get(0) which returns the pure DOM element instead of a jQuery magic-array wrapping the element. I still find strange (that eventually gonna change :D) to add the possibility to match a specified selector in the .parent() method if it only applies to the direct parent... I don't really need all the parents here, so it may be more efficient having a method that stops looping through parents when the one we want is found. I guess I still can use .parent().parent().parent() as I know the div should be the third parent, but that would require change in the javacscript if i want to change the HTML structure... If you don't need all the parents, use .parents('div:first') or .parents('div').eq(0) as you've found out it's the jQuery way. I may even be so bold as to add you might like to try .closest()http://docs.jquery.com/Traversing/closestwhich is quite handy to find the closest matching element this included. Have fun. Michel Belleville
[jQuery] Re: AJAX requests in progress
I found the answer in the source. $.active tells you how many requests are pending (just like Ajax.activeRequestCount in prototype). Thanks all, Alun Harford
[jQuery] Re: Create PDF from js
Wow, marvellous project :) I'm trying to use I think that is the solution to my problem. Kind regards :) Massimo On 9 Nov, 21:11, Scott Sauyet scott.sau...@gmail.com wrote: On Nov 9, 12:30 pm, m.ugues m.ug...@gmail.com wrote: The problem using server side option is that I have a web site with a lot of pages. For every page I need to generate a PDF; so I need to create a Java class for every html page where I reproduce the html layout (since the PDF must be the same as the html shown on the screen). If you're using Java, I'd suggest that you use the Flying Saucer project [1], which is an XHTML renderer that can output PDF. You should be able to create the normal HTML output stream from the servlet, passing it into the renderer and stream it out as PDF. Or there could be simpler techniques depending upon how your HTML is generated. Good luck, -- Scott [1]https://xhtmlrenderer.dev.java.net/
[jQuery] Figured it Out
I think I figured it out in a weird way. So I had recently bought a new Dell Mini 10v Netbook and installed Ubuntu Netbook Remix on it to do coding/web work while I was traveling. I zipped the files on my netbook in linux and transfered them through a share I have to my windows 7 desktop. This wasn't a problem but for some reason I think linux archieve files are read only be default maybe, and perhaps there are some other permission issues there? I found this out because I had transfered a spreadsheet to edit it and found out it was read only when I shared it out from linux. So this time I just transfered the files straight with my corsair flash drive and then zipped it on my windows machine, after uploading it/expanding/cleaning up/etc, the site works the way it was suppose to, just as it was offline on my linux machine. So I think that you were totally right with that last reply, I had never thought that file permissions and things like that could give the same symtoms of incorrect file paths. Thanks a lot dude! Thanks, Wes -- View this message in context: http://old.nabble.com/jQuery-only-works-in-offline-files-%21-tp26261050s27240p26284854.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
Re: [jQuery] Figured it Out
Glad you've got it working. Kudos for using Ubuntu on your netbook too b^^d Michel Belleville 2009/11/10 wesley.bunton wesley.bun...@gmail.com I think I figured it out in a weird way. So I had recently bought a new Dell Mini 10v Netbook and installed Ubuntu Netbook Remix on it to do coding/web work while I was traveling. I zipped the files on my netbook in linux and transfered them through a share I have to my windows 7 desktop. This wasn't a problem but for some reason I think linux archieve files are read only be default maybe, and perhaps there are some other permission issues there? I found this out because I had transfered a spreadsheet to edit it and found out it was read only when I shared it out from linux. So this time I just transfered the files straight with my corsair flash drive and then zipped it on my windows machine, after uploading it/expanding/cleaning up/etc, the site works the way it was suppose to, just as it was offline on my linux machine. So I think that you were totally right with that last reply, I had never thought that file permissions and things like that could give the same symtoms of incorrect file paths. Thanks a lot dude! Thanks, Wes -- View this message in context: http://old.nabble.com/jQuery-only-works-in-offline-files-%21-tp26261050s27240p26284854.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] selector performance
I am using jquery 1.3.2. I was wondering which is faster and why: $('#my-id .main table tr.my-class') or $('#my-id .main table tr.my-class') or $('#my-id tr.my-class')
Re: [jQuery] selector performance
As to the why I don't know, but as to the which the solution is quite easy : do a benchmark. Michel Belleville 2009/11/10 Adam Tistler atist...@gmail.com I am using jquery 1.3.2. I was wondering which is faster and why: $('#my-id .main table tr.my-class') or $('#my-id .main table tr.my-class') or $('#my-id tr.my-class')
Re: [jQuery] Ajax Load, CSS Insert on Loading Gif and Fade Out
Why not just use something like this: http://plugins.jquery.com/project/loading On Tue, Nov 10, 2009 at 5:37 AM, artesianwells joshua...@gmail.com wrote: Hello, I would like to add css through jquery to make a loading gif appear. Say in the css stylesheet itself, #vv is set without a width, so I was hoping to put a width on the css loading gif background image in jquery to make it appear. If this is not possible to do in jquery, then a style:non alternative and then making the css show in jquery would be fine. unfortunately I do not know how to do either of this in jquery or how to make the gif fade in and out. The concept syntax (non working) I had in mind is below. (Note: If wondering, I have 3 divs on my website to be loading in a slider, but only the first div needs to show the loading gif, the first slide) $(function(){ $(#first).empty().fadeIn(80)$('#vv').css('width:48px').fadeOut(500); $(#first).load(ahahpage.html #u); $(#second).load(ahahpage.html #k); $(#third).load(ahahpage.html #b); }); Thankyou
[jQuery] JavaScript switched off
Hi, What’s the best way to redirect when a users browser has JavaScript switched off? I currently use something like the below in the head but it isn’t W3C compliant. noscript Javascript is disabled Redirecting meta http-equiv=Refresh content=0;URL=disabled.html / /noscript
Re: [jQuery] selector performance
i would the best thing to do regardless of your selection method is to store them in variables. like this var obj = $(.wrap); Now you have basically created an object reference point. you won't need to re-create in 99% of cases. so lets re-use our object reference. // get the width of your object without making a new reference var obj_width = obj.width(); // get a child element in your object without making a new reference to your object // also you are only searching within your object, not the whole page. performance boost here var element_in_object = $(.elementclass, obj); //if you only need to make one reference in your whole script theres no need to make so //many vars. //you can point directly to it // this would be more efficient if you don't need to reference your wrap class again var my_element = $(.wrap .elementclass); I already know theres gonna be people ready to debate on their methods :) but this is my thoughts. On Tue, Nov 10, 2009 at 5:47 PM, Michel Belleville michel.bellevi...@gmail.com wrote: As to the why I don't know, but as to the which the solution is quite easy : do a benchmark. Michel Belleville 2009/11/10 Adam Tistler atist...@gmail.com I am using jquery 1.3.2. I was wondering which is faster and why: $('#my-id .main table tr.my-class') or $('#my-id .main table tr.my-class') or $('#my-id tr.my-class')
Re: [jQuery] JavaScript switched off
Well. you could use a server side language like : php or asp.net if you have an apache server you can do a redirect in your .htaccess if you have an IIS server you can accomplish the same in your IIS Manager On Tue, Nov 10, 2009 at 5:53 PM, factoringcompare.com firstfacto...@googlemail.com wrote: Hi, What’s the best way to redirect when a users browser has JavaScript switched off? I currently use something like the below in the head but it isn’t W3C compliant. noscript Javascript is disabled Redirecting meta http-equiv=Refresh content=0;URL=disabled.html / /noscript
[jQuery] better way to access JSON than with $.getJSON on each button press
Hi, I have created a function that binds behavior to a set of links, the result of clicking being that the container div of the navigations gets a new background image, and eventually gets html injected into the div as well (currently that part is not coded)... Given the following function, it seems like there would be a better way to handle accessing the JSON file each time a link is pressed than doing a $.getJSON each time. Is there a prescribed way for storing that JSON after the first call and being able to access it later? Or, could I set up variables each time the particular part of the JSON file is called and if that same button is clicked again, return the variable instead of accessing the JSON? Thanks for the help, $.getJSON(/dev/home/pp.json, function(data){ $('.pomonaPeople').css('background', 'url(' + data.items [0].background + ' )' ); $('.pomonaPeople').append(data.items[0].content); $('.pomonaPeople .loading').fadeOut(FADE); }); // create navigation var ppButton = $('#pp-nav ul li a'); ppButton.click( function(event) { event.preventDefault(); var aIndex = $(this).attr('href'); var destination = $('.pomonaPeople'); destination.append('div class=loading/div'); $.getJSON(/dev/home/pp.json, function(data){ destination.css('background', 'url(' + data.items [aIndex].background + ' )' ); destination.find('.loading').fadeOut(FADE); }); });
[jQuery] jQuery Media Plugin w/ custom skin?
Hello, I'm having issues implementing a custom skin using the media plugin. I'm not sure if it's a syntax problem, or if i don't have the directory set up correctly. The video plays, but the custom skin is not loaded. Here's my code to initialize the plugin $('.media').media({ width: 497, height:407, autoplay: true, src: 'flash/videoPlayer.swf', flashvars: { url: 'videos/new.flv', skin: 'SkinCustom' } /*where SkinCustom lives inside a folder called skins */ }); and the HTML a href=flash/videoPlayer.swf class=mediaVideo/a Also, I would eventually need the url flashvars to pull in a variable. Is this possible, and would it be simple as declaring url: $myURL ? Thanks much. ~amy
[jQuery] tablesorter help - sort by date wont work!
Hi I'm using www.tablesorter.com's implementation of a sort table, however it does not seem to recognize my client's preferred date format (10 November 2009). Day Month Year - 10 November 2009 [CODE] $(document).ready(function() { $(#oldArticles).tablesorter( {sortList: [[0,1]]} ); }); [/CODE] It is sorting by day only all help is much appreciated! -- View this message in context: http://old.nabble.com/tablesorter-help---sort-by-date-wont-work%21-tp26286016s27240p26286016.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: tablesorter help - sort by date wont work!
it does not seem to recognize my client's preferred date format were you expecting it to? this will need a custom parser i can whip up an example, but it'll be a little bit before i could get to that On Nov 10, 11:14 am, sethwb josepatt...@gmail.com wrote: Hi I'm usingwww.tablesorter.com'simplementation of a sort table, however it does not seem to recognize my client's preferred date format (10 November 2009). Day Month Year - 10 November 2009 [CODE] $(document).ready(function() { $(#oldArticles).tablesorter( {sortList: [[0,1]]} );}); [/CODE] It is sorting by day only all help is much appreciated! -- View this message in context:http://old.nabble.com/tablesorter-help---sort-by-date-wont-work%21-tp... Sent from the jQuery General Discussion mailing list archive at Nabble.com.
Re: [jQuery] tablesorter help - sort by date wont work!
thank you very much MorningZ... Any kind of example would be great! -- View this message in context: http://old.nabble.com/tablesorter-help---sort-by-date-wont-work%21-tp26286016s27240p26286785.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Form values disappearing
I am using the JQuery Address plug-in to bookmark state changes in an application. The application allows a user to run a search of a document set. When the user requests a search that has not been run before, the search is performed and then the search form and search results are cached using data(), so that they can be retrieved later if the user presses the back button. All of the above is working fine except that the form values in the form that is being cached are being lost. If I use bind() instead of livequery(), the form values are retained. However, as I am re- populating the form div with the cached form later, I cannot used bind () or the event bindings are lost. Here is the relevant code. Anyone have any ideas as to why this is happening and how to fix it? HTML div id=portlet:namespace/_cmlSearch_container div id=portlet:namespace/_cmlSearch_msg class=alert style=display: none;/div form action=portlet:renderURL windowState=RAW/ name=portlet:namespace/_cmlSearch_form id=portlet:namespace/ _cmlSearch_form method=post input type=hidden name=searchType value=simplesearch div id=portlet:namespace/_cmlSearch_simpleKeyword: input type=text id=keyword name=keyword /nbsp; input id=cmlSearch_submitBtnTop type=submit value=Search//div br / a id=portlet:namespace/_cmlSearch_advancedSearchLink href=javascript:void(0)img src=%=response.encodeURL (request.getContextPath() + /images/icon_plus.gif)% name=portlet:namespace/_cmlSearch_advancedSearchLinkIcon id=portlet:namespace/_cmlSearch_advancedSearchLinkIcon border=0 alt=+ /nbsp;Advanced Search/a div id=portlet:namespace/_cmlSearch_advanced style=display: none; table id=portlet:namespace/_cmlSearch_advancedSearchFields class=cmlAdvancedFieldsTable jsp:include page=cmlform.jsp/ /table br / input id=cmlSearch_submitBtnBottom type=submit value=Search/ nbsp;input id=cmlSearch_clearBtnBottom type=reset value=Clear/ /div /form div id=portlet:namespace/_cmlSearch_loading style=width: 300px; margin-left: auto; margin-right: auto; text-align: center; display: none;img src='/cml/images/ajaxLoader.gif'/div div id=portlet:namespace/_cmlSearch_searchResults/div /div jQuery(document).ready(function() { var nsPrefix = #portlet:namespace/_; jQuery(nsPrefix+cmlSearch_form).livequery(submit, function(){ var uId = new Date().getTime(); var hash = searchresults/portlet:namespace//+uId; jQuery.address.value(hash); return false; }); }); FROM jQuery.address.change(function(event){ var cachedContent = jQuery(nsPrefix+cmlSearch_container).data(uId); //check the cache to see if this search was already run if(cachedContent == undefined){ //if not, do the search and cache the search container contents var url2Call = jQuery(nsPrefix+cmlSearch_form).attr(action); var formData = jQuery(nsPrefix+cmlSearch_form).serialize(); doSearch(url2Call, formData, ns, uId); }else{ //if yes, re-populate the search container with cached content jQuery(nsPrefix+cmlSearch_container).html(cachedContent); } FROM doSearch(url2Call, formData, ns, uId){ complete: function(xhr, textStatus){ jQuery(nsPrefix+cmlSearch_loading).hide(); var content = jQuery(nsPrefix+cmlSearch_container).html(); jQuery(nsPrefix+cmlSearch_container).data(uId,content); }
[jQuery] Re: tablesorter help - sort by date wont work!
here you go: http://jsbin.com/enata/edit Keep one major thought in mind with this awesome plugin: it's not very smart (it tries, but in the end, it can only account for so much)... it can sort numbers and strings... anything more complicated than that it needs direction :-) On Nov 10, 11:43 am, sethwb josepatt...@gmail.com wrote: thank you very much MorningZ... Any kind of example would be great! -- View this message in context:http://old.nabble.com/tablesorter-help---sort-by-date-wont-work%21-tp... Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] sliding previous/next content
Hi all! So what I'm trying to do is so simple but it's not working.. All I want to do is to slide up/down to the next/previous content. Here's the code: id=calendar a href=# class=arrowUpPrevious/a h3Calendar/h3 ul class=events current liContent1/li liContent2/li liContent3/li /ul ul class=events liContent4/li liContent5/li liContent6/li /ul ul class=events liContent7/li liContent8/li liContent9/li /ul a href=# class=arrowDownNext/a /div Clicking arrow up down should bring up Content4, 5 and 6 and so on. Here's how I'm trying to do it: $('.arrowUp').click(function(){ $('.events.current').removeClass(current).previous().slideDown (slow).addClass(current); }); $('.arrowDown').click(function(){ $('.events.current').removeClass(current).next().slideUp (slow).addClass(current); }); the .events has display:none; and .events.current has display:block; What am I doing wrong? Is there a easier way to do this?
Re: [jQuery] tablesorter help - sort by date wont work!
I've been trying to get this parser I've customized to work, but I'm not sure about the syntax... would this be easier to help me with/is this on the right track? ts.addParser({ id: shortDate, is: function(s) { return /\d{2,}[\s]\w{4,}[\s]\d{4,}/.test(s); }, format: function(s,table) { var c = table.config; s = s.replace(/\-/g, ); if(c.dateFormat == us) { // reformat the string in ISO format s = s.replace(/(\d{2,})[\s](\w{4,})[\s](\d{4,})/, $3/$1/$2); } else if(c.dateFormat == uk) { //reformat the string in ISO format s = s.replace(/(\d{2,0})[\s](\w{4,})[\s](\d{4,})/, $3/$2/$1); } else if(c.dateFormat == dd/mm/yy || c.dateFormat == dd-mm-yy) { s = s.replace(/(\d{2,0})[\s](\w{4,})[\s](\d{4,})/, $1/$2/$3); } return $.tablesorter.formatFloat(new Date(s).getTime()); }, type: numeric }); -- View this message in context: http://old.nabble.com/tablesorter-help---sort-by-date-wont-work%21-tp26286016s27240p26287153.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: JavaScript switched off
On Nov 10, 10:53 am, factoringcompare.com firstfacto...@googlemail.com wrote: What’s the best way to redirect when a users browser has JavaScript switched off? How about going the other way? document.location.href=enabled.html; Better still when possible is to unobtrusively enhance the non-js page with additional functionality. That is generally the cleanest way of making sure that your content is accessible, available to search engines, and still has all your cool dynamic behavior for those with JS on. -- Scott
Re: [jQuery] sliding previous/next content
First try the examples for .slideUp()http://docs.jquery.com/Effects/slideUpand .slideDown() http://docs.jquery.com/Effects/slideDown. You'll notice slideUp() is a way to make an element disappear as if it was sliding up, and slideDown() is a way to make an element appear as if it was sliding down, Michel Belleville 2009/11/10 Marco Barbosa marco.barbos...@gmail.com Hi all! So what I'm trying to do is so simple but it's not working.. All I want to do is to slide up/down to the next/previous content. Here's the code: id=calendar a href=# class=arrowUpPrevious/a h3Calendar/h3 ul class=events current liContent1/li liContent2/li liContent3/li /ul ul class=events liContent4/li liContent5/li liContent6/li /ul ul class=events liContent7/li liContent8/li liContent9/li /ul a href=# class=arrowDownNext/a /div Clicking arrow up down should bring up Content4, 5 and 6 and so on. Here's how I'm trying to do it: $('.arrowUp').click(function(){ $('.events.current').removeClass(current).previous().slideDown (slow).addClass(current); }); $('.arrowDown').click(function(){ $('.events.current').removeClass(current).next().slideUp (slow).addClass(current); }); the .events has display:none; and .events.current has display:block; What am I doing wrong? Is there a easier way to do this?
Re: [jQuery] tablesorter + AJAX
try: $('#mainContent').html(data).find('#ratesTable').tablesorter(); On Mon, Nov 9, 2009 at 20:38, sumdog sum.not...@gmail.com wrote: Hey there, I've read through several AJAX+tablesorter posts and am still a little confuzzled on this. I am loading an entire table into a div like so: div id=mainContent pLoading.../p /div script type=text/javascript $(document).ready( function() { $.get('/ajaxRates',{}, function(data) { $('#mainContent').html(data); $('#ratesTable').tablesorter(); }); }); /script The /ajaxRates URL returns the HTML table. I place it into the div using the function right after it. I then call that new table and apply tablesorter() to it. If I do this to an inplace table, it works fine. It's just the AJAX table I'm having trouble with. The new table should be fully in the DOM by the time that function returns correct? Is there some other event I need to wait for or attach somehow in order to get this to work correctly? Thanks Sumit Khanna http://penguindreams.org -- View this message in context: http://old.nabble.com/tablesorter-%2B-AJAX-tp26278194s27240p26278194.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: tablesorter help - sort by date wont work!
Got an example of each date the value could be? On Nov 10, 12:01 pm, sethwb josepatt...@gmail.com wrote: I've been trying to get this parser I've customized to work, but I'm not sure about the syntax... would this be easier to help me with/is this on the right track? ts.addParser({ id: shortDate, is: function(s) { return /\d{2,}[\s]\w{4,}[\s]\d{4,}/.test(s); }, format: function(s,table) { var c = table.config; s = s.replace(/\-/g, ); if(c.dateFormat == us) { // reformat the string in ISO format s = s.replace(/(\d{2,})[\s](\w{4,})[\s](\d{4,})/, $3/$1/$2); } else if(c.dateFormat == uk) { //reformat the string in ISO format s = s.replace(/(\d{2,0})[\s](\w{4,})[\s](\d{4,})/, $3/$2/$1); } else if(c.dateFormat == dd/mm/yy || c.dateFormat == dd-mm-yy) { s = s.replace(/(\d{2,0})[\s](\w{4,})[\s](\d{4,})/, $1/$2/$3); } return $.tablesorter.formatFloat(new Date(s).getTime()); }, type: numeric }); -- View this message in context:http://old.nabble.com/tablesorter-help---sort-by-date-wont-work%21-tp... Sent from the jQuery General Discussion mailing list archive at Nabble.com.
Re: [jQuery] Re: JavaScript switched off
the op wanted to redirect without javascript On Tue, Nov 10, 2009 at 7:02 PM, Scott Sauyet scott.sau...@gmail.comwrote: On Nov 10, 10:53 am, factoringcompare.com firstfacto...@googlemail.com wrote: What’s the best way to redirect when a users browser has JavaScript switched off? How about going the other way? document.location.href=enabled.html; Better still when possible is to unobtrusively enhance the non-js page with additional functionality. That is generally the cleanest way of making sure that your content is accessible, available to search engines, and still has all your cool dynamic behavior for those with JS on. -- Scott
Re: [jQuery] sliding previous/next content
Sorry for previous mail, I misclicked on send before finishing it. So : First try the examples for .slideUp()http://docs.jquery.com/Effects/slideUpand .slideDown() http://docs.jquery.com/Effects/slideDown. You'll notice slideUp() is a way to make an element disappear as if it was sliding up, and slideDown() is a way to make an element appear as if it was sliding down, as explained in the doc. That's not exactly what you're looking for apparently. What you are looking for is a way to move all the uls at once up or down. Now if I wanted to do that, I'd do it this way : - in the div#calendar, put another div.slider that'll actually be moving wrapping the uls - through css give div#calendar a relative positionning so it'll be the offset parent for div.slider, give div.sider a relative positionning too so it'll also be an offset parent for the uls, make div#calendar overflow hidden so it'll act as a content window rather than get bigger to fit around the uls - on click on previous / next, detect current ul, get the previous / next ul, read it's position using .position()http://docs.jquery.com/CSS/positionto determine how much sliding is needed for div.slider to slide it just right, then use .animate() http://docs.jquery.com/Effects/animate to trigger the slide Though there may very well already be plugins that do just what you need so check wether you will be re-inventing the wheel here. Michel Belleville 2009/11/10 Michel Belleville michel.bellevi...@gmail.com First try the examples for .slideUp()http://docs.jquery.com/Effects/slideUpand .slideDown() http://docs.jquery.com/Effects/slideDown. You'll notice slideUp() is a way to make an element disappear as if it was sliding up, and slideDown() is a way to make an element appear as if it was sliding down, Michel Belleville 2009/11/10 Marco Barbosa marco.barbos...@gmail.com Hi all! So what I'm trying to do is so simple but it's not working.. All I want to do is to slide up/down to the next/previous content. Here's the code: id=calendar a href=# class=arrowUpPrevious/a h3Calendar/h3 ul class=events current liContent1/li liContent2/li liContent3/li /ul ul class=events liContent4/li liContent5/li liContent6/li /ul ul class=events liContent7/li liContent8/li liContent9/li /ul a href=# class=arrowDownNext/a /div Clicking arrow up down should bring up Content4, 5 and 6 and so on. Here's how I'm trying to do it: $('.arrowUp').click(function(){ $('.events.current').removeClass(current).previous().slideDown (slow).addClass(current); }); $('.arrowDown').click(function(){ $('.events.current').removeClass(current).next().slideUp (slow).addClass(current); }); the .events has display:none; and .events.current has display:block; What am I doing wrong? Is there a easier way to do this?
Re: [jQuery] Re: JavaScript switched off
Scott's solution, as he mentioned, goes the other way, but still does what the OP wanted. If the user doesn't have JS enabled, the location.href won't fire, and the current page will still render fine. If the user does have JS enabled, the location.href call will redirect them to the JS-enhanced page. The OP was looking for a W3C compliant solution. AFAIK, Scott's option fits that bill. On Tue, Nov 10, 2009 at 9:20 AM, waseem sabjee waseemsab...@gmail.comwrote: the op wanted to redirect without javascript On Tue, Nov 10, 2009 at 7:02 PM, Scott Sauyet scott.sau...@gmail.comwrote: On Nov 10, 10:53 am, factoringcompare.com firstfacto...@googlemail.com wrote: What’s the best way to redirect when a users browser has JavaScript switched off? How about going the other way? document.location.href=enabled.html; Better still when possible is to unobtrusively enhance the non-js page with additional functionality. That is generally the cleanest way of making sure that your content is accessible, available to search engines, and still has all your cool dynamic behavior for those with JS on. -- Scott -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.
[jQuery] Re: Load image with an ajax preloader?
Hi michel, Tx for the explanation, i am trying your suggestion and it indeed works like a charm. At the moment i am updating div imagePreview depending on a combo of select menu options. As i understand it the ajax-loader.gif keeps on spinning in the background. Is there a way to check if the image is really loaded and if not display another image as background saying no image found. working code at the moment $(#size_update).change(function(){ var srcSize = $(option:selected, this).val(); var srcColor = $(#color_update option:selected).text(); var imgSrc = srcColor+-+srcSize; $('#imagePreview').html('img src='+imgSrc+'.jpg/'); }); $(#color_update).change(function(){ var srcColor = $(option:selected, this).val() ; var srcSize = $(#size_update option:selected).text(); var imgSrc = srcColor+-+srcSize; $('#imagePreview').html('img src='+imgSrc+'.jpg/'); }); .loading { background: url(ajax-loader.gif) no-repeat center center; }
Re: [jQuery] Re: Sound
It is really impressive!!! - Original Message - From: shapper mdmo...@gmail.com To: jQuery (English) jquery-en@googlegroups.com Sent: Saturday, November 07, 2009 8:35 AM Subject: [jQuery] Re: Sound On Nov 5, 11:14 pm, Erik Beeson erik.bee...@gmail.com wrote: No jQuery necessarily needed for this. Plenty of information here: http://www.google.com/search?q=html+embed+audio Not if a Play and Stop button is required ... Or maybe even a music list. I found the following: http://www.happyworm.com/jquery/jplayer/ What do you think? Thanks, Miguel
Re: [jQuery] Re: Load image with an ajax preloader?
This is straight JS, I never used it before and I'm not sure how cross-browser it is but this should help : http://talideon.com/weblog/2005/02/detecting-broken-images-js.cfm Michel Belleville 2009/11/10 123gotoandplay wesweatyous...@gmail.com Hi michel, Tx for the explanation, i am trying your suggestion and it indeed works like a charm. At the moment i am updating div imagePreview depending on a combo of select menu options. As i understand it the ajax-loader.gif keeps on spinning in the background. Is there a way to check if the image is really loaded and if not display another image as background saying no image found. working code at the moment $(#size_update).change(function(){ var srcSize = $(option:selected, this).val(); var srcColor = $(#color_update option:selected).text(); var imgSrc = srcColor+-+srcSize; $('#imagePreview').html('img src='+imgSrc+'.jpg/'); }); $(#color_update).change(function(){ var srcColor = $(option:selected, this).val() ; var srcSize = $(#size_update option:selected).text(); var imgSrc = srcColor+-+srcSize; $('#imagePreview').html('img src='+imgSrc+'.jpg/'); }); .loading { background: url(ajax-loader.gif) no-repeat center center; }
[jQuery] Submit Function Code Help
I have the same code one multiple pages and would like to clean that up. It is for submitting a form via Ajax. The only thing different in the form would be the form id , where its going and the validation rules. But all of that is taken care of thru standard naming convections thru-out the site. I have on the page with the form: $(document).ready( function() { $('#newEntry').bind('submit', function(testForm)); }); In the external js: function testForm() { var form_id = this.attr('id'); var form_url = $(this).attr('action'); var page_target = form_url.substr(1).replace( new RegExp( / ,g), _ ); var hide_form = page_target + '_form'; alert(form_id); alert(form_url); alert(page_target); alert(hide_form); return false; } Can someone see where I am going wrong here so far? No alerts or anthing. Thanks Dave
[jQuery] CSS3 content attribute for page
Hallo all. I'm using CSS3 for pagination in print mode @page { @bottom-center { content: Page counter(page) of counter (pages); } } This works fine but I would like to extract the text content from the css and put it in a div in the html page: something like this: div id=footer style= Page span id=pagenumber/ of span id=pagecount/ /div So in my css I changed the @page directive in this way @page { @top-center { content: #footer; } } #pagenumber:before { content: counter(page); } #pagecount:before { content: counter(pages); } The before works fine but I cannot position the div id=footer the the top-center of the page. Where is the problem? Kind regards Massimo
[jQuery] Re: better way to access JSON than with $.getJSON on each button press
On Nov 10, 11:11 am, roryreiff roryre...@gmail.com wrote: Given the following function, it seems like there would be a better way to handle accessing the JSON file each time a link is pressed than doing a $.getJSON each time. Is there a prescribed way for storing that JSON after the first call and being able to access it later? There is no prescribed way. One (untested) possibility would be to store it inside a closure: var getData = (function() { var storedData; return function(callback) { if (storedData) callback(storedData) else $.getJSON(/dev/home/pp.json, function(data) { storedData = data; callback(storedData); }); }; })(); Then use it like this: getData(function(data) { $('.pomonaPeople').css('background', 'url(' + data.items [0].background + ' )' ); $('.pomonaPeople').append(data.items[0].content); $('.pomonaPeople .loading').fadeOut(FADE); }); var ppButton = $('#pp-nav ul li a'); ppButton.click( function(event) { event.preventDefault(); var aIndex = $(this).attr('href'); var destination = $('.pomonaPeople'); destination.append('div class=loading/div'); getData(function(data){ destination.css('background', 'url(' + data.items [aIndex].background + ' )' ); destination.find('.loading').fadeOut(FADE); }); }); This turns code you might like to be synchronous into asynchronous code, but other than that I think would do what you want. There would be something to be said for making this a little more generic so that you would generate a similar function for each JSON url you want to use. That's left as an exercise for the reader. Cheers, -- Scott
[jQuery] Re: better way to access JSON than with $.getJSON on each button press
On Nov 10, 1:08 pm, Scott Sauyet scott.sau...@gmail.com wrote: There would be something to be said for making this a little more generic so that you would generate a similar function for each JSON url you want to use. That's left as an exercise for the reader. Or for me! :-) This simply makes more sense: function getData(url) { var storedData; return function(callback) { if (storedData) callback(storedData) else $.getJSON(url, function(data) { storedData = data; callback(storedData); }); }; }; var ppData = getData(/dev/home/pp.json); var otherData = getData(/path/to/other/json); ppData(function(data) { $('.pomonaPeople').css('background', 'url(' + data.items [0].background + ' )' ); $('.pomonaPeople').append(data.items[0].content); $('.pomonaPeople .loading').fadeOut(FADE); }); var ppButton = $('#pp-nav ul li a'); ppButton.click( function(event) { event.preventDefault(); var aIndex = $(this).attr('href'); var destination = $('.pomonaPeople'); destination.append('div class=loading/div'); ppData(function(data){ destination.css('background', 'url(' + data.items [aIndex].background + ' )' ); destination.find('.loading').fadeOut(FADE); }); }); Cheers, -- Scott
[jQuery] Can FullCalendar Handle Multiple Google Calendars?
I have been exploring the FullCalendar plugin (http://arshaw.com/ fullcalendar/), which works nicely. I have been able to display information from one of my Google calendars, but have not had success with multiple calendars. Does anyone know if this is possible? Thanks - george
[jQuery] Re: Benefit of extending jQuery with a function vs. a JavaScript function?
I agree with the other respondents... rather create your own namespace and encapsulate your functions there. e.g. var myApp = { }; myApp.myTestFunction = function (param1) { alert(param1); } myApp.myTestFunction('my function!'); Actually, don't listen to me :) look at a few of Crockford's video's and the patterns he talks about. I especially like the following example that allows you very easily build contained modules using the correct scopes. (source: http://javascript.crockford.com/code.html) var collection = (function () { var keys = [], values = []; return { get: function (key) { var at = keys.indexOf(key); if (at = 0) { return value[at]; } }, set: function (key, value) { var at = keys.indexOf(key); if (at 0) { at = keys.length; } keys[at] = key; value[at] = value; }, remove: function (key) { var at = keys.indexOf(key); if (at = 0) { keys.splice(at, 1); value.splice(at, 1); } } }; }()); On Nov 9, 6:27 pm, marty.mcgee mcgee.ma...@gmail.com wrote: Hello, Marty McGee here. I was hoping to open a discussion about the benefits of extending jQuery with your own custom functions versus simply writing your functions in JavaScript and calling them without extending jQuery first. Please enlighten me and the rest of the humble jQuery library addicts. Thanks to all. For example, this: $(function(){ $.function_name = function test() { alert('in function'); } }); Versus this: $(function(){ test(); }); function test() { alert('in function'); } -
[jQuery] Re: CSS3 content attribute for page
On Nov 10, 1:00 pm, m.ugues m.ug...@gmail.com wrote: I'm using CSS3 for pagination in print mode [ ... ] The before works fine but I cannot position the div id=footer the the top-center of the page. This doesn't seem to have anything to do with jQuery. Are you looking for a jQuery solution to your CSS problem? There's a great css discussion list at http://www.css-discuss.org/ -- Scott
[jQuery] Re: sliding previous/next content
Hi Michel! Thanks for the reply! Not sure if there are plugins to simply slide up/down. I already tried with positioning instead of display:none , but using slideUp and slideDown. It almost worked but I couldn't figure it out what was missing. The last ul wouldn't show up. I'll give a try again using animate instead. Will post my result here later. On Nov 10, 6:22 pm, Michel Belleville michel.bellevi...@gmail.com wrote: Sorry for previous mail, I misclicked on send before finishing it. So : First try the examples for .slideUp()http://docs.jquery.com/Effects/slideUpand .slideDown() http://docs.jquery.com/Effects/slideDown. You'll notice slideUp() is a way to make an element disappear as if it was sliding up, and slideDown() is a way to make an element appear as if it was sliding down, as explained in the doc. That's not exactly what you're looking for apparently. What you are looking for is a way to move all the uls at once up or down. Now if I wanted to do that, I'd do it this way : - in the div#calendar, put another div.slider that'll actually be moving wrapping the uls - through css give div#calendar a relative positionning so it'll be the offset parent for div.slider, give div.sider a relative positionning too so it'll also be an offset parent for the uls, make div#calendar overflow hidden so it'll act as a content window rather than get bigger to fit around the uls - on click on previous / next, detect current ul, get the previous / next ul, read it's position using .position()http://docs.jquery.com/CSS/positionto determine how much sliding is needed for div.slider to slide it just right, then use .animate() http://docs.jquery.com/Effects/animate to trigger the slide Though there may very well already be plugins that do just what you need so check wether you will be re-inventing the wheel here. Michel Belleville 2009/11/10 Michel Belleville michel.bellevi...@gmail.com First try the examples for .slideUp()http://docs.jquery.com/Effects/slideUpand .slideDown() http://docs.jquery.com/Effects/slideDown. You'll notice slideUp() is a way to make an element disappear as if it was sliding up, and slideDown() is a way to make an element appear as if it was sliding down, Michel Belleville 2009/11/10 Marco Barbosa marco.barbos...@gmail.com Hi all! So what I'm trying to do is so simple but it's not working.. All I want to do is to slide up/down to the next/previous content. Here's the code: id=calendar a href=# class=arrowUpPrevious/a h3Calendar/h3 ul class=events current liContent1/li liContent2/li liContent3/li /ul ul class=events liContent4/li liContent5/li liContent6/li /ul ul class=events liContent7/li liContent8/li liContent9/li /ul a href=# class=arrowDownNext/a /div Clicking arrow up down should bring up Content4, 5 and 6 and so on. Here's how I'm trying to do it: $('.arrowUp').click(function(){ $('.events.current').removeClass(current).previous().slideDown (slow).addClass(current); }); $('.arrowDown').click(function(){ $('.events.current').removeClass(current).next().slideUp (slow).addClass(current); }); the .events has display:none; and .events.current has display:block; What am I doing wrong? Is there a easier way to do this?
Re: [jQuery] tablesorter help - sort by date wont work!
thank you!!! For some reason now i cant get the click function to work on the headers - any ideas? MorningZ wrote: here you go: http://jsbin.com/enata/edit Keep one major thought in mind with this awesome plugin: it's not very smart (it tries, but in the end, it can only account for so much)... it can sort numbers and strings... anything more complicated than that it needs direction :-) On Nov 10, 11:43 am, sethwb josepatt...@gmail.com wrote: thank you very much MorningZ... Any kind of example would be great! -- View this message in context:http://old.nabble.com/tablesorter-help---sort-by-date-wont-work%21-tp... Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context: http://old.nabble.com/tablesorter-help---sort-by-date-wont-work%21-tp26286016s27240p26288808.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Error '$this' is undefined
Hi all, I have the following html, of which I want to replace the text Cart with My Shopping Bag (The Veiw Cart text is near the end) Code: div class=cart-summaryspan id=catCartSummary quote=False vertical=Falsetable cellspacing=0 class=cartSummaryTabletrtd class=cartSummaryItem1 item(s), Total: #163;0.00 a class=cartSummaryLink href=/ OrderRetrievev2.aspx?CatalogueID=45965View Cart/a/td/tr/ table/span/div Now I need the ability to actually choose the actual text I want to replace, as there is other text, where I can not replace the whole text line due to different numbers produced on the fly, so I cant use the following, which does work. Code: $(.cartSummaryLink).html(View My Shopping Bag'); I need to use the following one, but my experience is poor Code: $('.cartSummaryLink').val( $this.val().replace('Cart','My Shopping Bag') ); I get the following error Message: '$this' is undefined any help will be appreciated. Thanks John
[jQuery] Validate not working in IE, but working in Firefox.
Hello there, I know this has come up before, but I've checked it through and I think I must be going blind as I can't see why it's not currently doing any validation. Firefox works fine, but IE doesn't do any validation and just goes straight to the form processor. The code I'm using is: script type=text/javascript src=js/jquery.validate.js/script script type=text/javascript !-- $().ready(function() { // validate signup form on keyup and submit $(#signupForm).validate({ rules: { realname: required, telephone: { required: true, digits: true }, email: { required: true, email: true }, pickup: required, dropoff: required }, messages: { realname: Please enter your full name, telephone: Please enter your telephone number without spaces, email: Please enter a valid email address, pickup: Please enter the date you would like the package to be picked up, dropoff: Please enter the date you would like the package to be delivered } }); }); //-- /script - and - form class=cmxform id=signupForm method=post action=rcfp.php fieldset legendYour Details:/legend p label for=titleTitle:/label select name=title id=title option selected=selectedPlease Choose:/option option value=Mr.Mr./option option value=Mrs.Mrs./option option value=Ms.Ms./option option value=MissMiss/option /select /p p label for=realnameContact name*:/label input name=realname id=realname size=30 / /p p label for=addressoneAddress line 1:/label input name=addressone id=addressone size=30 / /p p label for=addresstwoAddress line 2:/label input name=addresstwo id=addresstwo size=30 / /p p label for=townTown:/label input name=town id=town size=30 / /p p label for=countyCounty:/label input name=county id=county size=30 / /p p label for=postcodePostcode:/label input name=postcode id=postcode size=30 / /p p label for=emailEmail address*:/label input name=email id=email size=30 / /p p label for=telephoneDaytime telephone number*:/label input name=telephone id=telephone size=30 / /p /fieldset fieldset legendPackage Details:/legend p label for=numberofpackagesNumber of packages:/label select name=numberofpackages id=numberofpackages option selected=selectedPlease Choose:/option option value=11/option option value=22/option option value=33/option option value=44/option option value=55/option option value=66/option option value=77/option option value=88/option option value=99/option option value=1010/option /select /p plabel for=weightWeight of package:/label input type=text name=weight id=weight size=30 / /p p label for=heightHeight of package:/label input type=text name=height id=height size=30 / /p p label for=depthDepth of package:/label input type=text name=depth id=depth size=30 / /p p label for=lengthLength of package:/label input type=text name=length id=length size=30 / /p /fieldset fieldset legendDelivery Details:/legend p label for=pickupDate of pickup*:/label input type=text name=pickup id=pickup size=30 / /p p label for=pickuptimeTime of pickup:/label input type=text name=pickuptime id=pickuptime size=30 / /p p label for=dropoffDate of drop-off*:/label input type=text name=dropoff id=dropoff size=30 / /p p label for=dropofftimeTime of drop-off:/label input type=text name=dropofftime id=dropofftime size=30 / /p p label for=deliverynameName or company:/label input type=text name=deliveryname id=deliveryname size=30 / /p p label for=deliveryaddressoneAddress line 1:/label input type=text name=deliveryaddressone id=deliveryaddressone size=30 / /p p label for=deliveryaddresstwoAddress line 2:/label input type=text name=deliveryaddresstwo id=deliveryaddresstwo size=30 / /p p label for=deliverytownTown:/label input type=text name=deliverytown id=deliverytown size=30 / /p p label for=deliverycountyCounty:/label input type=text name=deliverycounty id=deliverycounty size=30 / /p p label for=deliverypostcodePostcode:/label input type=text name=deliverypostcode id=deliverypostcode size=30 / /p p label for=notesNotes or requests for this delivery:/label textarea name=notes id=notes cols=30 rows=10/textarea input type=text name=check id=check title=Humans
[jQuery] Why does 'attr' work with 'divs' and not 'p's'?
Using the following code jquery var originalTitle=$(a.basic).attr(title); $(div.area1).text(originalTitle); html pThis is where the original title should go/p div class=area1/div I get the expected title attribute written into the 'div'. However, if I swap the 'div' for a 'p' the result is that the 'href' is written into the paragraph instead of the title. Here is the modified code that produces the unexpected result: jquery var originalTitle=$(a.basic).attr(title); $(p.area1).text(originalTitle); html pThis is where the original title should go/p div class=area1/div I suspect the problem is cockpit error but I wondered if there is some restriction on this combination of jquery that requires a 'div' for the area where the text is written. Alternatively is someone can point out my error that would be much appreciated. Thanks.
[jQuery] Re: clueTip display inconsistently
Hey Wendy/Karl... can you share your findings?? I am having the same problem just using the default style. I am using the basic function with default style! and the results I get are a tip box with dark, 60% transparent background... very confused and have spent a couple of days on this...!! any help would be appreciated! Cheers, Simone On Oct 26, 7:14 pm, wendy.constantine wendy.constant...@cengage.com wrote: I've discovered the problem. Thanks again for your help, Karl.
[jQuery] How to send Object Graphs to the server via AJAX?
Hello i'm using jqGrid with the type clientSide and plan to send editted data back to the server. With a $.ajax-Request i receive an object with sub-objects as JSON from the server and can directly work with them in javascript, e.g. add the sub-objects to the grid, and display other properties in input-fields etc... After the user editted some data within the grid, i will send all data back to the server with another ajax-call. At first, i tried out to send a JSON-Object, but all sub-objects were flatten to a string object [Object]. So i tried out the option processData:false. But with this option the whole POST-Data are empty (debugged with firebug). I'm thinking about putting together all data from the grid as a large query-string. But rather i would it do with native jquery-things. Can anybody give me some hints? Thanks a lot!
[jQuery] Jquery Lavalamp - prevent the hovering effect on a specific class/item
Hi guys, As the subject indicates, is it possible to prevent the lavalamp effert from moving to a specific li within the ul list? .. for instance if the li has a class li class=skip, once the user hovers over that li the hovering image remains on the currently selected item Any indications or help would be greatly appreciated! Thanks
[jQuery] Re: Superfish
I also experienced this. If the active class is on the third level the .sf-breadcrumb wont show up. But if the active class is on the second level it's okay. Only happens in Safari so far. Any ideas? On Oct 21, 11:33 am, Ron timd...@gmail.com wrote: I have setupsuperfishon my wp powered site, its all working fine and looking great in firefox/ie, butsafariis well out of wak. The jquery effects are working, however the second level styles seem to be removed. If anyone could take a look insafariand help me out it would be much appreciated. http://121.0.6.68/~islheal/
[jQuery] jquery and json triggers no event.
Hi, I'm attempting to build a list of items that are to be clickable to delete. - I am able to visually build the list and it is added to a div I want. My a.delete click event is never triggered when I click on a json built hyperlink. If I manually add the html like a class='delete'test/a then the event is triggered (which tells me it shouldn't be a javascript error...). What am I missing? Tia, S. My jquery functions look like: $().ready(function() { $('#members').click(function(){ $.getJSON(check_group_membership.php, {members:$(#members).val (), groups:$(#groups).val() } , function(json){ var output = ; for (var i = 0; i json.length; i++) { //alert( json[i].name ); output+= a class='delete' + json[i].name + /abr; } $(#assignedGroups).append( output ); }); }); $(a.delete).click(function() { alert(test); });
[jQuery] Show Loading
Is there a way that when your loading content to display the loading div for a minimum amount of time? I am requesting Ajax grab some content for me and while its doing so I show the loading spinner but in some cases it just flashes for a millisecond and gone. Can it be set to show for a minimum length of time? $(a.add).click(function (){ var url_id = $(this).attr(href); var div_id = url_id.substr(1).replace( new RegExp( / ,g), _ ); $('#' + div_id).after('div class=loading/div'); $('.loading').fadeIn('normal'); $.ajax({ type: GET, url: url_id, cache: true, success: function(response){ $('.loading').fadeOut('normal').remove(); $('#' + div_id).html(response).slideToggle('slow'); } }); return false; }); Thanks Dave
[jQuery] trying to get jQuery plugin to work with onclick IE6/7
Okay, So my code works in FF, IE8 and Safari (I've only tested in the latest versions of all). But in IE6 and IE7 I get an error saying Object doesnt support this property or method. a onclick=javascript: $(this).curvesLeadForm({gymSource:'Curves Anaheim Hills, CA',address1Source:'6507 E. Serrano Avenue, Ste. A amp; B',address2Source:'Anaheim, CA 92807',loaderSource:$(this).parent ().siblings('li.float_col').children('img.curves_loader'), clickedLink:this}); return false; title=Request Free Fitness Plan class=fitness_plan_link href=http://www.curvesinformation.com/ index.php?Referrer=GFCamp;campaign=GF target=_blank/a curvesLeadForm is a custom plugin I made and the parameters are all being passed to overwrite default plugin values. My initial thought is that earlier versions of IE do not like the '$ (this).curvesLeadForm' function call. I need to call curvesLeadForm using the link that is clicked as there are several of these links on the same page and they all use different parameters for the curvesLeadForm call. Let me know if anything is needed further. There is not viewable version of what I am trying to do, sorry.
[jQuery] Re: clueTip display inconsistently
Hello everyone... figured out what was wrong... I am using sharepoint and was trying to add the stylesheet to a content editor webpart as a link... it was not working... and funy thing is that some sort of style was being loaded... anyhow... thanks for the wonderful tool :) Cheers, Simone On Nov 10, 1:01 pm, Simone simone.chec...@gmail.com wrote: Hey Wendy/Karl... can you share your findings?? I am having the same problem just using the defaultstyle. I am using the basic function with defaultstyle! and the results I get are a tip box with dark, 60% transparent background... very confused and have spent a couple of days on this...!! any help would be appreciated! Cheers, Simone On Oct 26, 7:14 pm, wendy.constantine wendy.constant...@cengage.com wrote: I've discovered the problem. Thanks again for your help, Karl.- Hide quoted text - - Show quoted text -
Re: [jQuery] Error '$this' is undefined
just do it Code: $('.cartSummaryLink').val( $*(*this*)*.val().replace('Cart','My Shopping Bag') ); 2009/11/10 Daybreak0 daybre...@gmail.com Hi all, I have the following html, of which I want to replace the text Cart with My Shopping Bag (The Veiw Cart text is near the end) Code: div class=cart-summaryspan id=catCartSummary quote=False vertical=Falsetable cellspacing=0 class=cartSummaryTabletrtd class=cartSummaryItem1 item(s), Total: #163;0.00 a class=cartSummaryLink href=/ OrderRetrievev2.aspx?CatalogueID=45965View Cart/a/td/tr/ table/span/div Now I need the ability to actually choose the actual text I want to replace, as there is other text, where I can not replace the whole text line due to different numbers produced on the fly, so I cant use the following, which does work. Code: $(.cartSummaryLink).html(View My Shopping Bag'); I need to use the following one, but my experience is poor Code: $('.cartSummaryLink').val( $this.val().replace('Cart','My Shopping Bag') ); I get the following error Message: '$this' is undefined any help will be appreciated. Thanks John -- Abraços.. Marcel Araujo System Analyst Developer Java/PHP/RIA Linux User #490101
Re: [jQuery] Why does 'attr' work with 'divs' and not 'p's'?
jquery var originalTitle=$(a.basic).attr(title); $(p.area1).text(originalTitle); html pThis is where the original title should go/p div class=area1/div Your selector is looking for a paragraph with a class of 'area1'. However, there is no paragraph with that class in your markup. -DA
[jQuery] Re: trying to get jQuery plugin to work with onclick IE6/7
On Nov 10, 2:22 pm, Matthew mvbo...@gmail.com wrote: So my code works in FF, IE8 and Safari (I've only tested in the latest versions of all). But in IE6 and IE7 I get an error saying Object doesnt support this property or method. I know the site is not visible, but can you make a small test case using JS Bin [1]? I'm guessing that just trying to make this sample will lead you to a solution, but if not, people will have much more to go on when trying to help. Things to check: Does it work when bound (without the customization) from a $(a.fitness_plan_link).click(...) handler? That should help determine if the issue is the javascript: pseudo-protocol. Can the plug-in run using some defaults rather than the parameter? If so, try it with the defaults, which will let you know if whether it's something in your parameter. Can you log the loaderSource from inside the plug-in? If not, then perhaps it's something IE is doing to make you loaderSource selectors not work properly. -- Scott [1] http://jsbin.com/
Re: [jQuery] tablesorter help - sort by date wont work!
Hey, I got the click to work - syntax error, however, it still doesn't seem to want to sort correctly on the Months Where in the script does it actually do the sorting? It actually doesn't seem to be sorting in any apparent order, kind of random like. Is this the right return format: mmdd? -- View this message in context: http://old.nabble.com/tablesorter-help---sort-by-date-wont-work%21-tp26286016s27240p26291369.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Error '$this' is undefined
Thank you Code: $('.cartSummaryLink').val( $*(*this*)*.val().replace('Cart','My Shopping Bag') ); Unfortunately the above does not work New error in IE and FF is Message: Syntax error Char: 35
Re: [jQuery] tablesorter + AJAX
Nevermind. My original approach worked. I had just forgotten to use th tags instead of td tags in the thead section of the table in my AJAX call. Silly mistake. aquaone wrote: try: $('#mainContent').html(data).find('#ratesTable').tablesorter(); On Mon, Nov 9, 2009 at 20:38, sumdog sum.not...@gmail.com wrote: Hey there, I've read through several AJAX+tablesorter posts and am still a little confuzzled on this. I am loading an entire table into a div like so: div id=mainContent pLoading.../p /div script type=text/javascript $(document).ready( function() { $.get('/ajaxRates',{}, function(data) { $('#mainContent').html(data); $('#ratesTable').tablesorter(); }); }); /script The /ajaxRates URL returns the HTML table. I place it into the div using the function right after it. I then call that new table and apply tablesorter() to it. If I do this to an inplace table, it works fine. It's just the AJAX table I'm having trouble with. The new table should be fully in the DOM by the time that function returns correct? Is there some other event I need to wait for or attach somehow in order to get this to work correctly? Thanks Sumit Khanna http://penguindreams.org -- View this message in context: http://old.nabble.com/tablesorter-%2B-AJAX-tp26278194s27240p26278194.html Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context: http://old.nabble.com/tablesorter-%2B-AJAX-tp26278194s27240p26292599.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] fadeOut problem
Hi, I've found a minor issue with the fadeOut animation - I'm not sure if this can be fixed easily, or even if it is a bug at all... this appears in a case which I suppose is quite rare, when the element's height is 0, but the element is visible on the screen anyway. When fadeOut is called on this element, nothing happens and it stays visible. Try this code (tested in FF 3.5 and Safari 4.0): html head script type=text/javascript src=http://jqueryjs.googlecode.com/ files/jquery-1.3.2.js/script /head body button onclick=$('#box').fadeOut('normal');Fade out/ buttonbrbr div id=box style=position: absolute; top: 50px; width: 100px; div style=border: 1px solid black; margin: -1px; / /div /body /html If you press the button, the black line doesn't fade out. It does if you remove the margin: -1px attribute. I've come across this while using the searchlight plugin (http://ryanwilliams.org/2009/jul/28/ search-light-jquery-plugin) - if the search doesn't return any results, the list div shows up empty with only the box shadow visible, and then when you click somewhere on the page, the shadow doesn't disappear, as it does when the list isn't empty. Regards, Jakub
[jQuery] Re: trying to get jQuery plugin to work with onclick IE6/7
Scott, thanks for your time, I have been banging my head on the desk for a while. I edited the code down and used JS Bin: http://jsbin.com/ehoxu The original jQuery plugin uses ajax to bring in a form from a php page and does some other things, but my watered down version on JS Bin seems to generated the same results in the browsers I tested the full version in. I will try the other suggestions you made although I'm not sure about binding a click event to the 'a' tags. I think I am stuck with onclick () since the page is generated dynamically and I have to get values from a database then pass them into the curvesLeadForm function using on page php echos. I guess there are ways around using onclick but they seem to involve rewriting a lot of code. Thanks again. ~ Matthew On Nov 10, 12:52 pm, Scott Sauyet scott.sau...@gmail.com wrote: On Nov 10, 2:22 pm, Matthew mvbo...@gmail.com wrote: So my code works in FF, IE8 and Safari (I've only tested in the latest versions of all). But in IE6 and IE7 I get an error saying Object doesnt support this property or method. I know the site is not visible, but can you make a small test case using JS Bin [1]? I'm guessing that just trying to make this sample will lead you to a solution, but if not, people will have much more to go on when trying to help. Things to check: Does it work when bound (without the customization) from a $(a.fitness_plan_link).click(...) handler? That should help determine if the issue is the javascript: pseudo-protocol. Can the plug-in run using some defaults rather than the parameter? If so, try it with the defaults, which will let you know if whether it's something in your parameter. Can you log the loaderSource from inside the plug-in? If not, then perhaps it's something IE is doing to make you loaderSource selectors not work properly. -- Scott [1]http://jsbin.com/
Re: [jQuery] Show Loading
I was working on adding this feature to the loading plugin a few weeks ago. I finished it today: http://jquery-values.googlecode.com/svn/other/loading/jquery.loading.js On Tue, Nov 10, 2009 at 11:17 AM, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: Is there a way that when your loading content to display the loading div for a minimum amount of time? I am requesting Ajax grab some content for me and while its doing so I show the loading spinner but in some cases it just flashes for a millisecond and gone. Can it be set to show for a minimum length of time? $(a.add).click(function (){ var url_id = $(this).attr(href); var div_id = url_id.substr(1).replace( new RegExp( / ,g), _ ); $('#' + div_id).after('div class=loading/div'); $('.loading').fadeIn('normal'); $.ajax({ type: GET, url: url_id, cache: true, success: function(response){ $('.loading').fadeOut('normal').remove(); $('#' + div_id).html(response).slideToggle('slow'); } }); return false; }); Thanks Dave
[jQuery] Re: Show Loading
Nathan's plugin looks like the way to go, but before I saw his plugin I would always just show some loading div or paragraph before the ajax call, then hide it in your 'success:' function in the ajax call. $('#loader).fadeIn(500); do your ajax thing success: function(){ $('#loader).fadeOut(500); } You can also use setTimeOut to extend the time the fadeIn is showing. However, do give respect to Nathan's work, use his plugin, I plan on using it from here on out whenever I need to either simulate loading or am actually loading something via ajax. On Nov 10, 4:02 pm, Nathan Bubna nbu...@gmail.com wrote: I was working on adding this feature to the loading plugin a few weeks ago. I finished it today: http://jquery-values.googlecode.com/svn/other/loading/jquery.loading.js On Tue, Nov 10, 2009 at 11:17 AM, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: Is there a way that when your loading content to display the loading div for a minimum amount of time? I am requesting Ajax grab some content for me and while its doing so I show the loading spinner but in some cases it just flashes for a millisecond and gone. Can it be set to show for a minimum length of time? $(a.add).click(function (){ var url_id = $(this).attr(href); var div_id = url_id.substr(1).replace( new RegExp( / ,g), _ ); $('#' + div_id).after('div class=loading/div'); $('.loading').fadeIn('normal'); $.ajax({ type: GET, url: url_id, cache: true, success: function(response){ $('.loading').fadeOut('normal').remove(); $('#' + div_id).html(response).slideToggle('slow'); } }); return false; }); Thanks Dave
Re: [jQuery] Error '$this' is undefined
$this should be $(this). Hth, Joe On Nov 10, 2009 2:12 PM, Daybreak0 daybre...@gmail.com wrote: Hi all, I have the following html, of which I want to replace the text Cart with My Shopping Bag (The Veiw Cart text is near the end) Code: div class=cart-summaryspan id=catCartSummary quote=False vertical=Falsetable cellspacing=0 class=cartSummaryTabletrtd class=cartSummaryItem1 item(s), Total: #163;0.00 a class=cartSummaryLink href=/ OrderRetrievev2.aspx?CatalogueID=45965View Cart/a/td/tr/ table/span/div Now I need the ability to actually choose the actual text I want to replace, as there is other text, where I can not replace the whole text line due to different numbers produced on the fly, so I cant use the following, which does work. Code: $(.cartSummaryLink).html(View My Shopping Bag'); I need to use the following one, but my experience is poor Code: $('.cartSummaryLink').val( $this.val().replace('Cart','My Shopping Bag') ); I get the following error Message: '$this' is undefined any help will be appreciated. Thanks John
[jQuery] Validate Plugin - addMethod with Custom Messages?
Hi guys, I've been trying to work this out for about 7 hours - no exaggeration. I just cannot seem to work it out :-( I have used the sample code from custom-methods-demo.html $.validator.addMethod(buga, function(value) { return value == buga; }, 'Please enter buga!'); and I am trying to make it so i can have custom messages. Ideally like this... $.validator.addMethod(buga, function(value) { var message = ''; if(value == 'word'){ message = 4 letters or more; return false; } else if(value == 'test'){ message = Numbers Only; return false; } else if(value == 'great'){ message = Message 3; return false; }else{ return true; } }, message); I'm using it as follows: rules: { username: { buga: true } } Any help on how to do this would be great! Thanks so much for reading this. Many thanks.
[jQuery] JQuery/PHP/MySQL Best Practice Sample Application?
Can someone point me to a JQuery/PHP/MySQL application which has source code available which I can use to learn? Thanks.
[jQuery] Problem with drop down menu
I'm just picking up javascript and Jquery. I'm trying to do a drop down menu. I've downloaded several and tried to use their code but they all seem to have issues with my menu. What is going on? My current problem is that when a person rollsover just the li that it then opens all of the dropdowns causing the user to have to enter and leave each of the parent li. But if I hide them all before doing the slidedown then I get a realy bad flicker problem. I have spent 2 solid days on this and it should be simple. What do I do? Code: // JavaScript Document $(document).ready(function () { $('.mainnav li').mouseenter(Menu.show); $('.mainnav li ul').mouseleave(Menu.hide); }); var Menu = { show: function(event) { var menuLi= $(this).children(); $(menuLi).slideDown('slow'); }, hide: function(event) { $(this).hide(); } } html: ul class=mainnav lia href=about_the_disease.phpAbout the Disease/a ul class=dropdowns lia href=prevent_the_preventable.phpPrevent the Preventable/a/li lia href=venous_thromoembolism.phpVTE and Pulmonary Embolism/a/li lia href=vena_cava_filters_help.phpWhen Vena Cava Filters can help/a/li/ul/li lia href=#Procedure/a ul class=dropdowns lia href=sizing_the_cava.phpSizing the Cava/a/li lia href=choosing_a_filter.phpChoosing a Filter/a/li lia href=deployment.phpDeployment/a/li lia href=products.phpProduct Suite/a/li/ul /li lia href=casestudies.phpCase Studies/aul class=dropdowns lia href=casestudies.php#case1Case 1/a/li lia href=casestudies.php#case2Case 2/a/li lia href=casestudies.php#case3Case 3/a/li/ul /li /ul
[jQuery] Re: Ajax Load, CSS Insert on Loading Gif and Fade Out
Thankyou Nathan, I am sure this plugin and the filement group loading plugin are great, but I wanted a really lightweight solution that uses the css. If anyone knows how to set it up properly the chaining the etc (if possible using .empty()). Please post. I am sure there are others who would like a lightweight ahah solution. I am not interested in calling html through jquery with link to gif. Would like a flicker free loading gif that is already loaded through css Thanks from Josh On Nov 11, 2:30 am, Nathan Bubna nbu...@gmail.com wrote: Why not just use something like this: http://plugins.jquery.com/project/loading
[jQuery] events propagation once again
Hello everybody It is my first post here I guess. I must say - I love jQuery, thank you ! A few days ago I faced a problem that I cannot overcome and hope you can help me. In the group archive I saw similar problem, but solved in the way I have it solved, which is not sufficient for me right now. I have a menu, which contains links within li elements. I want JS to click on the real link whenever user clicks on the li element, but can't do that due to propagation. As one said there is a solution - catch attr(href) and use window.location.href ... that's workaround I used until now. But what if your link has target defined, causing new page to be opened in new window? That's the problem I faced and window.location.href is no longer correct solution here. At this moment, in case o QV Report (below), instead of clicking on the li button user have to click on the link. This would open new page or new tab depends on browser configuration. If I remove e.stopPropagation() from onclick event then click causes infinite loop. Here is my HTML code, simplified ol id=menu_ma li a href=index.php class=menulinkHome/a/li li a href=assets.php class=menulink Assets/a/li li a class='menulink' href='a.php' target='_blank'QV Report/ a/li /ol and js code $(#menu_ma a) .click(function(e){ $(this) .closest(li.ui-selectee).addClass(ui- selected) .siblings().removeClass(ui-selected); e.stopPropagation(); }) $(#menu_ma li) .hover( function(){ $(this).addClass(ui-state-highlight cursor-pointer); }, function(){ $(this).removeClass(ui-state-highlight cursor-pointer); }) .click(function(e){ link=$(this).find(a).attr(href); if(link!=undefined){ var me = $(this); var target = me.find(a).attr(target); if( me.find(a).attr(target)!= _blank) window.location.href=link; else{ me.find(a).trigger(click); } } }) As you see when li is clicked I trigger the click on a ... but this propagates again on li causing loop. I stopped the propagation but then click doeasn't work. I don't know how to solve this, but believe that there must be a solution or maybe different approach. If you have any ideas I will appreciate your comments. Best regards Norbert