[jQuery] Re: data is posted only once
how about try setting cache:false?
[jQuery] Re: tablesorter - Force Null / Empty Cells to the Bottom?
Not the prettiest code i've ever written, but: 1) It works :-) 2) Didn't touch one single character in tablesorter.js http://paste.pocoo.org/show/109306/ (Make sure you are viewing it in Firefox with FireBug going, or comment out the console.log-s and set Tablesorter's option of debug to false) On Mar 24, 12:30 am, Flight553 flight...@gmail.com wrote: you were on the right track with the .addParser method but there's no need to edit it inside the core code Ok, I'll bite. How? addParser() just lets you determine one value that goes to sortnumeric(a, b) or sorttext(a, b). Those methods are designed to put a value on top when sorting one direction, and on bottom when sorting the other direction. How can you get a value to always be sorted to the bottom using addParser? I know the patching I offered sucked, but don;t know how else to do it with the tablesorter.js code as exists. Suggestions?
[jQuery] Re: With IE8 out, how do you test for IE6?
On Mar 24, 2:09 pm, Jeffrey Kretz jeffkr...@hotmail.com wrote: I found Multiple IE to be inaccurate for certain types of CSS and Javascript. Could you elaborate on what types of CSS and Javascript? I've used VPC for my compatibility testing for some time now and swear by it. I have VPC on my Mac and it's just far too slow, especially testing *any* JQuery animations. KathyW.
[jQuery] Re: Keeping jquery codes up to date - best practise?
Yup, I hear ya all and now understand the issue. Especially Sam's point that upgrading automatically may break a function somewhere. Thanks so much for the replies. Much appreciated. I guess the last question is is there any advantage in linking to the google hosted scripts rather than hosting them myself? Doesn't this leave the possibility that if google's server is down my site breaks. Whereas if my server is down for some reason, well...it is ALL down.
[jQuery] Problem with jcarousel ( how to enable multiple columns )
Hi , I have problem related to jcarousel multiple columns. right now there's only one column showing. I need 3 columns to be displayed . Demo site: http://sorgalla.com/projects/jcarousel/examples/static_vertical.html... How do i add one more column to display the pictures. ? Can anyone help me plss... Thanks in advance Cheers ! Sagy
[jQuery] Re: tablesorter - Force Null / Empty Cells to the Bottom?
impressive but has some flaws (large numbers, sorting w/o clicking headers, etc). not a complete fix but definitely a 95+% solution -- neat! aquaone On Tue, Mar 24, 2009 at 00:00, MorningZ morni...@gmail.com wrote: Not the prettiest code i've ever written, but: 1) It works :-) 2) Didn't touch one single character in tablesorter.js http://paste.pocoo.org/show/109306/ (Make sure you are viewing it in Firefox with FireBug going, or comment out the console.log-s and set Tablesorter's option of debug to false) On Mar 24, 12:30 am, Flight553 flight...@gmail.com wrote: you were on the right track with the .addParser method but there's no need to edit it inside the core code Ok, I'll bite. How? addParser() just lets you determine one value that goes to sortnumeric(a, b) or sorttext(a, b). Those methods are designed to put a value on top when sorting one direction, and on bottom when sorting the other direction. How can you get a value to always be sorted to the bottom using addParser? I know the patching I offered sucked, but don;t know how else to do it with the tablesorter.js code as exists. Suggestions?
[jQuery] Re: [JQuery][Validate][Metadata] Custom error message.
Try this: INPUT TYPE=CHECKBOX id=suffix_{0} NAME=suffix[] value={1} validate=required:true,minlength:2, messages: { required:'required message', minlength: 'minlength message' } Jörn On Mon, Mar 23, 2009 at 9:14 PM, Korro sirko...@gmail.com wrote: Hello. I have code like this: INPUT TYPE=CHECKBOX id=suffix_{0} NAME=suffix[] value={1} validate=required:true,minlength:2 I'm using Validate with Metadata. How can I add custom validating error message for this field? Thanks in advance.
[jQuery] access :hover css properties of an element via jquery
hello! imagine i style the :hover pseudo-class of an element via css: .myitem{ background-color:green; } .myitem:hover{ background-color:red } Is it possible to retrieve the background-color property of the elemnent's :hover class via jquery? i tried the obvious : http://jsbin.com/idudi/edit $(function(){ var temp = $('#myitem:hover').css('background-color'); alert(color is +temp); }); But that didn't work. It returns the default state.
[jQuery] jBind With FireFox
Hi, I'm using JBind in my project. I have defined the template and binding data to it by using BindTo() method. This solution works very fine with Internet Explorer, but when it comes to Firefox and safari it fails Can somebody tell me how to get out this issue? We need to have firefox comaptibility. Regards, .Nil
[jQuery] Deleting an entire tr
Hello, I am trying to remove an entire tr row. Please, someone help me. This is what I use # $(document).ready(function() { $('a.delete').click(function(e) { e.preventDefault(); var parent = $(this).parent('td').parent('tr'); $.ajax({ type: 'get', url: 'delete.php', data: 'ajax=1delete=' + parent.attr('id').replace('image-',''), beforeSend: function() { parent.animate({'backgroundColor':'#fb6c6c'},300); }, success: function() { parent.slideUp(300,function() { parent.remove(); }); } }); }); }); in the tr, I have the id. And in the td contents I have a link plus a linked image of a trash bin with the class=delete. The idea is when you click on image it's supposed to remove entire tr with contents. # The only way I got it to work is to use use var parent = $(this).parent(); and place the id in a div and remove the linkage in the file and wrap around the entire linked image with a class=delete, the text , the image - I really need to keep the other link. so please what would be the correct syntax to get the tr? var parent = $(this).parent('td').parent('tr'); does not work for me. Thank you -- View this message in context: http://www.nabble.com/Deleting-an-entire-tr-tp22677143s27240p22677143.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] change video width while playing
is there anyway to change width of a embeded video with javascript so that user can click a button and the video will be bigger but it won't start from beginning. it is like veoh website where you can click a large button and the video will enlarge. Please help me out here. thank you
[jQuery] Re: Executing javascript that comes inside an AJAX response
it's not working. well eval(responseText); don't works. cells = divResult.getElementsByTagName(script); alert(cells.length); for (var i = 0; i cells.length; i++) { alert(cells[i].innerHTML); eval(cells[i].innerHTML); } sometesting(5); is working. but when the function sometesting() being called somewhere from ajaxresponse text, browser gives error. both ie and firefox. On Mar 15, 7:47 am, NightWatchman rushi...@gmail.com wrote: To execute javascript code returned by the server you need to use the javascript eval function on the string of script returned from the server. As far as I know changing the content of a div to a javascript block won't cause that javascript code to execute. I think you need to change: contentDiv.innerHTML = data; to eval(data); On Mar 14, 3:12 pm, Foreigner foreigne...@gmail.com wrote: Hi, I'm trying to use jQuery to get some HTML with Javascript using AJAX. My response gets inserted into the contentDiv element but my javascript inside the response doesn't get executed as the documentation says (http://docs.jquery.com/ Specifying_the_Data_Type_for_AJAX_Requests). Here goes my function with AJAX call: function loadHtml(obj) { if(obj.className == menuItem) { $.ajax({ type:GET, url:content/ + obj.id + .html, dataType: html, success: function(data, status) { contentDiv.innerHTML = data; } }); } } My response looks like: h3Some heading/h3 script type=text/javascript //Some javascript code /script
[jQuery] [Superfish] - Issue happened in IE 7 when integrated Superfish menu into Liferay
Dear, I've integrated Superfish menu into Liferay.it run ok in Firefox but occur an issue when I run on IE 7. I enclose my demo of issue http://www.5giay.vn/picture.php?albumid=3911pictureid=22491 Anyone can help me solve this issue? Thanks in advance Best regard.
[jQuery] Re: Validate plugin not working
Perhaps it says somewhere in the doc that the name attribute is required but I sure as hell couldn't find it. Anyway try adding the name attribute with the same value as your id attribute for each form element. You should be relieved by what you find ;) On Mar 23, 3:29 pm, Brendon Gleeson brendon.glee...@gmail.com wrote: Sorry I couldn't wait for my other post to showup, so I made a typo: html head titlejQuery Validation test/title script type=text/javascript src=js/jquery-1.3.2.min.js/script script type=text/javascript src=js/jquery-validate/ jquery.validate.js/script script type=text/javascript $(document).ready(function(){ $(#poesForm).validate({ rules : { name: { required : true } } }); }); /script /head body form id=poesForm input type=text id=name class=required / input type=submit / /form /body /html
[jQuery] jcarousel display problem
hi, i'm new here and i'm new using javascript and jquery. I hope you can help me. I'm trying to build a webpage with the following 3 jquery components: - jQuery Accordion Menu (http://www.michaeljacobdavis.com/tutorials/ statesavingaccordion.html) - jCarousel (http://sorgalla.com/jcarousel/) - Shadowbox.js (http://mjijackson.com/shadowbox/index.html) It is a bit hard for me to describe the problem. The best is you look at this page with my stage of development: http://www.projekt360.de/09/index.php If you klick on the second tab titled with 'projekte' you'll see thebproblem. The carousel is cropped. If you reload the page everything displays right. I figured out that the display problem won't occur when I don't use the accordion script. I already tried a lot of things but as I said before I don't know much about jquery and javascript. I would be glad if anyone could help me with this issue. (Sorry for my english)
[jQuery] Re: jQuery Validation Plugin ASP.NET
Zach, Try adding rules via the Validate method like so: $(document).ready(function() { $(#aspnetForm).validate({ rules: { TitleField: { minlength: 2 } } }); }); This worked for me in ASP.NET w/ master page. On Mar 23, 10:26 pm, Zach zachary.hun...@gmail.com wrote: I've tried to get this to work for the past 4 hours and I'm stuck. I've got a master page with the following scripts added. script type=text/javascript src=/RohmPortal/scripts/ jquery-1.3.2.js/script script type=text/javascript src=/RohmPortal/scripts/ jquery.validate.js/script this is the form tag on my master page form id=form1 runat=server in the HTML output of the page, it actually renders to aspnetForm. in the content page, this is what I have script type=text/javascript $().ready(function() { $('aspnetForm').validate(); $('.TitleField').rules(add, { minlength: 2 }); }); /script here is the control I'm trying to validate asp:TextBox ID=TitleField name=TitleField Width=390 Columns=30 MaxLength=100 runat=server EnableTheming=false CssClass=TitleField / here is the error I get when testing in IE7 Microsoft JScript runtime error: '$.data(...).settings' is null or not an object when I go to the debug in VS, it shows the $.data as being undefined. What am I missing, I've tried to use a id selector as well, without any luck. I've tested my selectors by changing background colors, and they alwasy work but why isn't this thing validating? I'm probably missing something simple, any help is GREATLY APPRECIATED! Thanks, Zach
[jQuery] Reusing script
Hi, I am using JQuery to show and hide sections of text within my page. The page has 10 sections of thext and 10 links. I want to initially hide all 10 sections of text, and then show section 3 when the link for section 3 is clicked, but make sure any previously shown sections are then hidden. Here is what I have used so far which dies wxactly what I want but seems very long winded. $(document).ready(function hideAll() { //$('.stepText').hide(); $('.step1').addClass('hiddenstep'); $('.step2').addClass('hiddenstep'); $('.step3').addClass('hiddenstep'); $('.step4').addClass('hiddenstep'); $('.step5').addClass('hiddenstep'); $('.step6').addClass('hiddenstep'); $('.step7').addClass('hiddenstep'); $('.step8').addClass('hiddenstep'); $('.step9').addClass('hiddenstep'); $('.step10').addClass('hiddenstep'); $('.step1').click(function(){ $('.step1').removeClass('hiddenstep'); $('.step2').addClass('hiddenstep'); $('.step3').addClass('hiddenstep'); $('.step4').addClass('hiddenstep'); $('.step5').addClass('hiddenstep'); $('.step6').addClass('hiddenstep'); $('.step7').addClass('hiddenstep'); $('.step8').addClass('hiddenstep'); $('.step9').addClass('hiddenstep'); $('.step10').addClass('hiddenstep'); }); $('.step2').click(function(){ $('.step1').addClass('hiddenstep'); $('.step2').removeClass('hiddenstep'); $('.step3').addClass('hiddenstep'); $('.step4').addClass('hiddenstep'); $('.step5').addClass('hiddenstep'); $('.step6').addClass('hiddenstep'); $('.step7').addClass('hiddenstep'); $('.step8').addClass('hiddenstep'); $('.step9').addClass('hiddenstep'); $('.step10').addClass('hiddenstep'); }); $('.step3').click(function(){ $('.step1').addClass('hiddenstep'); $('.step2').addClass('hiddenstep'); $('.step3').removeClass('hiddenstep'); $('.step4').addClass('hiddenstep'); $('.step5').addClass('hiddenstep'); $('.step6').addClass('hiddenstep'); $('.step7').addClass('hiddenstep'); $('.step8').addClass('hiddenstep'); $('.step9').addClass('hiddenstep'); $('.step10').addClass('hiddenstep'); }); $('.step4').click(function(){ $('.step1').addClass('hiddenstep'); $('.step2').addClass('hiddenstep'); $('.step3').addClass('hiddenstep'); $('.step4').removeClass('hiddenstep'); $('.step5').addClass('hiddenstep'); $('.step6').addClass('hiddenstep'); $('.step7').addClass('hiddenstep'); $('.step8').addClass('hiddenstep'); $('.step9').addClass('hiddenstep'); $('.step10').addClass('hiddenstep'); }); $('.step5').click(function(){ $('.step1').addClass('hiddenstep'); $('.step2').addClass('hiddenstep'); $('.step3').addClass('hiddenstep'); $('.step4').addClass('hiddenstep'); $('.step5').removeClass('hiddenstep'); $('.step6').addClass('hiddenstep'); $('.step7').addClass('hiddenstep'); $('.step8').addClass('hiddenstep'); $('.step9').addClass('hiddenstep'); $('.step10').addClass('hiddenstep'); }); $('.step6').click(function(){ $('.step1').addClass('hiddenstep'); $('.step2').addClass('hiddenstep'); $('.step3').addClass('hiddenstep'); $('.step4').addClass('hiddenstep'); $('.step5').addClass('hiddenstep'); $('.step6').removeClass('hiddenstep'); $('.step7').addClass('hiddenstep'); $('.step8').addClass('hiddenstep'); $('.step9').addClass('hiddenstep'); $('.step10').addClass('hiddenstep'); }); $('.step7').click(function(){ $('.step1').addClass('hiddenstep'); $('.step2').addClass('hiddenstep'); $('.step3').addClass('hiddenstep'); $('.step4').addClass('hiddenstep'); $('.step5').addClass('hiddenstep'); $('.step6').addClass('hiddenstep'); $('.step7').removeClass('hiddenstep'); $('.step8').addClass('hiddenstep'); $('.step9').addClass('hiddenstep'); $('.step10').addClass('hiddenstep'); }); $('.step8').click(function(){
[jQuery] Re: Make jeditable select show the option's text instead of value
I have the same problem. I have this: $(.category .jeditable, el).editable(submit_edited_data, { data: {'1':'blue', '2':'red', '3':'green'}, type: 'select', submit: ok }); The selects options are displayed correctly when I click on the editable area but when I select something - for example 'blue' - the '2' string is used to replace original text instead of 'blue'. Looks like this is a bug in jquery. Thanks On Mar 17, 2:18 pm, FSan fsa...@gmail.com wrote: I mean If I have this: {'E':'Letter E','F':'Letter F','G':'Letter G'} and the corresponding generated select with options. I want jeditable to display for example Letter F instead of F after selection. Is it possible? Thanks
[jQuery] Opacity Distortion in Internet Explorer after fadeOut, fadeIn
Please kindly assist me in solving this. After I apply a fadeOut in Internet Explorer, when I fadeIn again, the item has lesser opacity and this doesn't look good. How do I solve this please. (I use I.E. 7 and most of the clients I program for use I.E. 6)
[jQuery] Re: data is posted only once
no, didnt solve it. :( I uploaded it, so u can see it and get a closer look. http://193.6.52.132/ajaxsender/ 2009/3/24 Steven Yang kenshin...@gmail.com how about try setting cache:false?
[jQuery] Re: Very slow find
I need to hold some things in memory for later use, so pure html is not ideal. I will try JSON, if it will be under 5-7 seconds for 500 items, it should be ok. Thanks On Tue, 24 Mar 2009 06:01:33 +0100, Michael Geary m...@mg.to wrote: If you are free to change the XML format, are you free to change it completely? Could you change it to HTML instead, and format the HTML in the same way that you are doing in JavaScript now? Then you could simply use $('#content_window_pages').load(...); and it would be very fast. Or you could use JSON instead of XML and speed it up a lot, but HTML would be by far the fastest. Is either of those changes - to HTML or JSON - feasible? XML is the worst choice for this kind of operation. -Mike -- Martin Tiršel
[jQuery] Re: tablesorter - Force Null / Empty Cells to the Bottom?
Never said it was a ready for production with a zillion rows... just call it a proof of concept that tablesorter is *very* flexible, in fact I would call it the most flexible plugin I've seen in the 15 months or so i've been into jQuery.. given more time, and the need for me to use it, that parser could be tightened up.. in the end though, what I would do if i was presented with the problem of putting null rows at the bottom is do this when the table is generated from the server code (PHP, CF, .NET, etc) and put them into the tfoot... then the table would look the same plus tablesorter would leave them alone On Mar 24, 4:49 am, aquaone aqua...@gmail.com wrote: impressive but has some flaws (large numbers, sorting w/o clicking headers, etc). not a complete fix but definitely a 95+% solution -- neat! aquaone On Tue, Mar 24, 2009 at 00:00, MorningZ morni...@gmail.com wrote: Not the prettiest code i've ever written, but: 1) It works :-) 2) Didn't touch one single character in tablesorter.js http://paste.pocoo.org/show/109306/ (Make sure you are viewing it in Firefox with FireBug going, or comment out the console.log-s and set Tablesorter's option of debug to false) On Mar 24, 12:30 am, Flight553 flight...@gmail.com wrote: you were on the right track with the .addParser method but there's no need to edit it inside the core code Ok, I'll bite. How? addParser() just lets you determine one value that goes to sortnumeric(a, b) or sorttext(a, b). Those methods are designed to put a value on top when sorting one direction, and on bottom when sorting the other direction. How can you get a value to always be sorted to the bottom using addParser? I know the patching I offered sucked, but don;t know how else to do it with the tablesorter.js code as exists. Suggestions?
[jQuery] A question About jQuery
Hi, I am doing a master thesis about Javascript ajax frameworks, and I have a question about jQuery framework, and need your answer please. As I read, jQuery is not a new creation, but it is a new implementation of existing frameworks like Prototype and Moo.fx. is that true? if yes, Prototype alone is about 127 KB in size, so , How is jQuery only 118 KB? or it does not include everything from Prototype (In addition to Moo.fx). I hope you have time to answer my questions. Thanks alot, Greetings,
[jQuery] Alert on click of class alerts n amount of times (n = amount of same class in doc).
I'm listening to some generated elements in an iframe. These elements are given the class 'wp_sl'. I need to, when an element with this class is clicked, do some work with it. However, say I have generated 3 elements with the class 'wp_sl': el_1, el_2, el_3 Using the code below, if I click on the first element, I will be given an alert 3 times. If I click on the second, 2 times. And on the third, I will be alerted 1 time. I'm unsure why this is happening, because I can do the same outside of an iframe, and it works perfectly - only alerting for the element I click on. Code: [code] var my_frame = jQuery('#content_ifr').contents(); jQuery('.wp_sl', my_frame).click( function() { alert(hi) }); [/code]
[jQuery] $(document).ready and Firefox 3
Hi! We've just started to use jQuery in a project where we use it to load an external plugin based on what kind of browser the user is on. When loading the plugin we insert object-tags via JavaScript etc. Everything is working as expected regarding the loading and usage of the plugin except for one small thing. In Chrome, Safari and IE the page content is displayed before the plugin dialog is popped up (it's a plugin used to authenticate), but in Firefox the page content is displayed after the user has pressed submit or cancel in the plugin dialog. Maybe this has something to do with the behaviour regarding to when the DOM is ready or not. I've searched this mailing list and the internet and tried a couple of solutions. Putting the script-tag that loads our JavaScript at the bottom of the page, changed $ (document).ready() to jQuery(function() {} etc. None of those solutions seem to work. Does anyone have a clue how to solve this? It would be much appreciated! Tanks, Christer
[jQuery] Re: Bug on line 184
I forgot to mention that this is the autocomplete found here: http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ On Mar 23, 4:18 pm, ddorothy didoro...@gmail.com wrote: We discovered that when the auto complete values contain commas and you are not using the multiple input mode, the result would not show up in the input box (actually it would but it would be removed before you could tell if you were not stepping through the code). We discovered that on line 184 there is the following $.each(trimWords($input.val()), function(i, value) { request(value, findValueCallback, findValueCallback); }); However, trimWords in any other case is preceded by an if statement checking options.multiple. We made the following change to correct the issue: $.each(options.multiple ? trimWords($input.val()) : [$input.val()], function(i, value) { request(value, findValueCallback, findValueCallback); }); Thanks.
[jQuery] Re: Suggestion on solution for array to new html content
Thanks for the response mkmanning! So far that is similar to the solution I am using (with a small change of using html() instead of append() for the main div and no need for appendTo() since the main div is already part of the DOM). I was just wondering if there was an obvious shortcut with JQuery for doing something like this (taking an array of objects and turning them into content with data or event info to attach to those elements)... but looks like that may be the best bet then. Thanks again! On Mar 23, 11:59 pm, mkmanning michaell...@gmail.com wrote: Why not do two passes, since the array will have a one-to-one correspondence with the divs in the containing div? $(document).ready(function(){ var arr = [{content: 'some html 1', data: 'some data 1'},{content: 'some html 2', data: 'some data 2'},{content: 'some html N', data: 'some data N'}]; $('div').append($.map(arr,function(a){return 'div'+a.content +'/div';}).join('')).children('div').each(function(i,a){$(a).data ('testValue',arr[i].data)}).end().appendTo('body'); }); On Mar 23, 8:26 pm, sliver sliver2...@gmail.com wrote: Hi all, Ive been exploring various solutions for the following and was interested to hear other opinions: From AJAX call: [{content: 'some html 1', data: 'some data 1'}, {content: 'some html 2', data: 'some data 2'}, ... , {content: 'some html N', data: 'some data N'}] Desired: Take the array from above, wrap the content values in a div and then attach the data to the div. After this, set the new divs to be the content of another element. My first thought was to put the array through a map: $.map(ARRAY, function(a) { return $('div').html(a.content).data('testValue', a,data); }); however, you can't simply just take the output from that and use it as an argument in another element's html method: // Won't work $('div').html($.map(ARRAY, function(a) { return $('div').html (a.content).data('testValue', a,data);})); Ive been working through a few solutions, none of which I find to be very elegant... so, any thoughts on an elegant solution out there?
[jQuery] Re: [JQuery][Validate][Metadata] Custom error message.
Thanks, but after pasting Yours code, I get missing ) in parenthetical error. Do You have any idea how to solve it? Thanks.
[jQuery] Re: Validation plugin: combine functions with strings on remote error
Woohoo! That was easy enough. Thanks a ton for this amazing plugin. I'm sad that this is the first time I've used it. _ From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Jörn Zaefferer Sent: Monday, March 23, 2009 5:34 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Validation plugin: combine functions with strings on remote error Passing a function as a message happens all the time when using $.format(... {0}) as messages. The function is expected to return the formated message, so you can just return the string value you want to display at the end of your function. Jörn On Mon, Mar 23, 2009 at 10:39 PM, Andy Matthews amatth...@dealerskins.com wrote: I'm using the validation plugin to validate a field remotely. The validation portion works great, but I've got a question about the error message if the validation fails. I discovered that you can pass a function rather than a plain string as seen below in the remote key. The problem is that when I do this, I lose the ability to display a string of my choosing. Does anyone know how to accomplish both? messages: { pagealias: { required: 'Page alias is required', remote: function(){ // highlight the field $field.pulse(); // display message 'This page alias is already in use' } } } Andy Matthews Senior Web Developer www.dealerskins.com P Please consider the environment before printing this e-mail. Total customer satisfaction is my number 1 priority! If you are not completely satisfied with the service I have provided, please let me know right away so I can correct the problem, or notify my manager Aaron West at aw...@dealerskins.com.
[jQuery] Re: Alert on click of class alerts n amount of times (n = amount of same class in doc).
You're probably rebinding that event multiple times try jQuery('.wp_sl', my_frame).unbind().click( function() { alert (hi) }); markskilb...@googlemail.com wrote: I'm listening to some generated elements in an iframe. These elements are given the class 'wp_sl'. I need to, when an element with this class is clicked, do some work with it. However, say I have generated 3 elements with the class 'wp_sl': el_1, el_2, el_3 Using the code below, if I click on the first element, I will be given an alert 3 times. If I click on the second, 2 times. And on the third, I will be alerted 1 time. I'm unsure why this is happening, because I can do the same outside of an iframe, and it works perfectly - only alerting for the element I click on. Code: [code] var my_frame = jQuery('#content_ifr').contents(); jQuery('.wp_sl', my_frame).click( function() { alert(hi) }); [/code]
[jQuery] ie6 scrollbar
hi, i got some kind of pop-up banner which animates in the screen after the page loaded. if you scroll up or down it will animate back on the position it has to be. if you click on close it moves out of the screen. well actually i just animate the height of it so it doesn't really move out or in but nevermind. my problem now is: if i scrolled around and close the banner afterwards the page gets longer. i don't know why but i can scroll way down under the page where nothing is. this sucks. i hope someone got an idea. code: /** * pop-up werbebanner * +cookie */ var scrollpos = document.documentElement.scrollTop; var winh = document.documentElement.clientHeight; var pos = -1; var closed = 0; if(!$(body).hasClass(browser-ie6)) { var popcookie = $(.popup).attr(id); $(#popup-1).css({zIndex:101}); var popp= $.cookie('popp'); if (popp == popcookie) { $(.popup).css({height:0px}); }else{ $(.popup).css(bottom,pos); $(.popup).animate({height: 200px},1000); $(.popup .close).click(function() { $(.popup).animate({height: 0px},1000, function() { $(this).css({border:0px}); }); var popcookie = $(.popup).attr(id); $.cookie('popp', popcookie, { expires: 1 }); }); } }else{ $(.popup).before(div class='backgimg'/div); $(.backgimg).css (filter,progid:DXImageTransform.Microsoft.AlphaImageLoader (src='sites/default/themes/basic/images/popupbg.png', sizingMethod='scale'); $(.backgimg).css ({position:absolute,width:100%,left:0px,margin:0px,padding:0px,height:0px}); $(.popup).css({position:absolute,overflow:hidden}); var popcookie = $(.popup).attr(id); var popp= $.cookie('popp'); if (popp == popcookie) { $(.popup).css({height:0px}); }else{ $(.popup).css(bottom,pos); $(.backgimg).css(bottom,pos); $(.popup).animate({height: 200px},1000); $(.backgimg).animate({height: 200px},1000); $(.popup .close).click(function() { closed =1; $(.backgimg).animate({height: 0px},1000); $(.popup).animate({height: 0px},1000, function() { $(this).css({border:0px,display:none}).remove(); $(.backgimg).css({display:none}).remove(); }); var popcookie = $(.popup).attr(id); $.cookie('popp', popcookie, { expires: 1 }); }); if(closed==0){ $(window).scroll(function () { var scrollpos = document.documentElement.scrollTop; var winh = document.documentElement.clientHeight; var pos2 = scrollpos- 200+winh;//-49; $('.popup').css({top: pos2,bottom: 1px}); $(.backgimg).css({top: pos2,bottom: 1px}); }); } } } thanks in advance. --weidc
[jQuery] General question regarding speed
I am trying to figure the best way to maximize performance with data returned from ASP pages. Option one - return data in an HTML table. Let the host page's css format the table. Option two - return json data from the asp page and let the browser drop the data into a table and still let the host page do the final formatting. I guess the question is where the faster/least amount of processing time and transport of data is used. Other items of note - the application is an intranet where all users will have javascript enabled. Your collective wisdom is greatly appreciated.
[jQuery] Newbie Question: get id from A tag
Hello, I am not good at js. I want to get the id from A tag. E.g. a href=/comment.php class=clickme id=1234link/a I need the value 1234 from the code above, but dont know how to do it. Please help. Thanks.
[jQuery] Google Calendar-style table cell selection
Hello, I'm looking to mimick the row-selection technique used by Google in the week-view of their Calendaring app. It's not my goal to replicate it, I just want to do the date selection in a similar way. After studying the calendar with Firebug, I noticed that they seem to use a HTML table, with a TR element and several TD elements. The first TD element contains the time DIVs (00:00 - 23:00) with a height of say 100px. The second TD contains the half-time DIVs (00:00, 00:30, 01:00, etcetera) with a height of 50px each. At this point I don't know where to go exactly - Dynamically inserting a new DOM element on mousedown at the position ().top coordinates of the target cell, and resizing it until mouseup? - Coloring the inbetween cells (between mousedown and mouseup)? - Another way? Here's some code I came up with: http://gist.github.com/84059 Has anyone done this before? All tips and info are welcome. Thanks. Gijs
[jQuery] Array of Check Boxes
I'm not exactly sure the best way of asking this, so please let me know if I need to expand. I have a LARGE form. The form is broken up into a bunch of pieces. Basically, the user comes to the site and gets about 26 check boxes. They can check 1 box or all 26. Depending on how many boxes are checked is what other parts of the form to load. So there are 20 other sections of the form that the user could possibly have to fill out. What I am trying to do is figure out how to load these sections. First off, I am getting the answers to the checkboxes via an array and while loop. After that, what is the best way to tell the script which forms to line up for the user to answer them? var i=1; var formNumber = new Array(); while (i=26) { if ($(input[name=+i+]).parent('.checked').length) { formNumber[i] = $(input[name=+i+]).val(); alert(formNumber[i]); } i=i+1; } This does fine and will alert out the values of the boxes checked. I had to do the if statement like that because I am using the vChecks plugin to make the check boxes all purty like. If anyone has any ideas or suggestions as to what I should do that would be awesome. Is this something that will take more then just JavaScript or can it be done with jQuery alone? Obviously the end of the form it will send an email with PHP, but I wasn't sure what type of processing it would entitle beforehand. Suggestions are very much appreciated. I am new to jQuery but I think I have a good grasp of most of it. -- View this message in context: http://www.nabble.com/Array-of-Check-Boxes-tp22673885s27240p22673885.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: A question About jQuery
Although I don't wish to speak for John Resig, my understanding is that jQuery was inspired by Prototype and Moo.fx, but it's not simply a new implementation of them. IIRC, John initially used Moo.fx as a base, refactoring it along the way, but even in its earliest iterations, the effects code diverged quite a bit from Moo.fx. The whole library has gone through so many rewrites since then that it's probably safe to say that current versions of Prototype and Mootools are just as much inspired by jQuery as the other way around. As for the size difference, it's hard to say exactly where that comes from. They aren't feature-for-feature analogues. Some code might be terser in one library than in the other. Some features in one might not be present in the other. Prototype, for example, has a bunch of methods that extend native prototypes. jQuery does not. jQuery core includes some animation features that Prototype delegates to Scriptaculous. Please take the above comments as impressions only. They are not official pronouncements. Anything mentioned above should be corroborated by John Resig (preferably) or another member of the jQuery team before being quoted or accepted as true. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Mar 24, 2009, at 7:35 AM, Alaa wrote: Hi, I am doing a master thesis about Javascript ajax frameworks, and I have a question about jQuery framework, and need your answer please. As I read, jQuery is not a new creation, but it is a new implementation of existing frameworks like Prototype and Moo.fx. is that true? if yes, Prototype alone is about 127 KB in size, so , How is jQuery only 118 KB? or it does not include everything from Prototype (In addition to Moo.fx). I hope you have time to answer my questions. Thanks alot, Greetings,
[jQuery] Re: Newbie Question: get id from A tag
$(.clickme).attr(id); On 24 Mrz., 14:03, Jesse cdrp...@gmail.com wrote: Hello, I am not good at js. I want to get the id from A tag. E.g. a href=/comment.php class=clickme id=1234link/a I need the value 1234 from the code above, but dont know how to do it. Please help. Thanks.
[jQuery] Re: Jquery Media plugin - fails in ie
Thanks for that, Steve. Unfortunately it's no good. I'll keep looking! Matthew On Mar 23, 4:24 pm, Steve s...@quinn.com wrote: Hi Matthew, I had a similar problem and M. Alsup suggested I download an older version of the JW FLV (v3.8; current version is v4.3) player and the error (object expected from IE's script debugger) went away. Hope this helps On Mar 23, 8:09 am, matthew.ni...@googlemail.com matthew.ni...@googlemail.com wrote: I'm not sure if this is a problem with themediaplugin(malsup.com) or with swfobject, but in IE only, and only with flash content, there is a runtime error when the a tags are inside p tags. So this below will work for the .wmv file but fall down on the flv. pa class=video href=video/secondary-assessment-effective- questioning.wmvEffective Questioning (from Teachers' TV)/a/p pa href=video/test-flv.flv class=videoTest flv video/a/p The jquery is simply: $(document).ready(function() { $('.video').media( { width: 320, height: 260, autoplay: false, flashvars: { skin: 'video/snel-skin.swf' } } ); $('.audio').media( { width: 320, height: 100, autoplay: false, flashvars: { skin: 'video/snel-skin.swf' } } ); }); Any ideas? Matthew
[jQuery] Re: Validation plugin: combine functions with strings on remote error
Okay... Another question. I'm having an odd issue with the message area of the plugin, specifically with remote methods. When the remove method fires, as in my original post. The problem is that I want to do some additional error display when the error fires. Problem is that the message key appears to be getting triggered whether there's an error fired or not. For example, I'm checking to see if a key exists in the database. If it does, the message should be displayed, AND the fom field containing the key should have it's background color changed. The problem is that the background color changes whether the msg is displayed or not. Is this a bug, or intended behaviour? Here's my code to this point. messages: { pagealias: { required: 'Page alias is required', remote: function(){ // also highlight the field containing the error $field.pulse({ backgroundColors: ['#fff','#ea7f1e'] }).bind('focus', function(){ $(this).recover(); }); return 'This page alias is already in use'; } } } andy _ From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Jörn Zaefferer Sent: Monday, March 23, 2009 5:34 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Validation plugin: combine functions with strings on remote error Passing a function as a message happens all the time when using $.format(... {0}) as messages. The function is expected to return the formated message, so you can just return the string value you want to display at the end of your function. Jörn On Mon, Mar 23, 2009 at 10:39 PM, Andy Matthews amatth...@dealerskins.com wrote: I'm using the validation plugin to validate a field remotely. The validation portion works great, but I've got a question about the error message if the validation fails. I discovered that you can pass a function rather than a plain string as seen below in the remote key. The problem is that when I do this, I lose the ability to display a string of my choosing. Does anyone know how to accomplish both? messages: { pagealias: { required: 'Page alias is required', remote: function(){ // highlight the field $field.pulse(); // display message 'This page alias is already in use' } } } Andy Matthews Senior Web Developer www.dealerskins.com P Please consider the environment before printing this e-mail. Total customer satisfaction is my number 1 priority! If you are not completely satisfied with the service I have provided, please let me know right away so I can correct the problem, or notify my manager Aaron West at aw...@dealerskins.com.
[jQuery] Re: Alert on click of class alerts n amount of times (n = amount of same class in doc).
Can you give a little more detail on the markup? Is there a chance those elements are nested inside each other? On Mar 24, 6:16 am, MorningZ morni...@gmail.com wrote: You're probably rebinding that event multiple times try jQuery('.wp_sl', my_frame).unbind().click( function() { alert (hi) }); markskilb...@googlemail.com wrote: I'm listening to some generated elements in an iframe. These elements are given the class 'wp_sl'. I need to, when an element with this class is clicked, do some work with it. However, say I have generated 3 elements with the class 'wp_sl': el_1, el_2, el_3 Using the code below, if I click on the first element, I will be given an alert 3 times. If I click on the second, 2 times. And on the third, I will be alerted 1 time. I'm unsure why this is happening, because I can do the same outside of an iframe, and it works perfectly - only alerting for the element I click on. Code: [code] var my_frame = jQuery('#content_ifr').contents(); jQuery('.wp_sl', my_frame).click( function() { alert(hi) }); [/code]
[jQuery] Re: Reusing script
what are these classes? a tags? is there a div or something around all of them? i would do it like so: lets say they got a parent div class=whatever $(.whatever).children().click(function(){ $(.whatever).children().addClass('hiddenstep'); $(this).removeClass('hiddenstep'); }); well this should work but i didn't tested it. On 24 Mrz., 10:47, phelyer paulhel...@gmail.com wrote: Hi, I am using JQuery to show and hide sections of text within my page. The page has 10 sections of thext and 10 links. I want to initially hide all 10 sections of text, and then show section 3 when the link for section 3 is clicked, but make sure any previously shown sections are then hidden. Here is what I have used so far which dies wxactly what I want but seems very long winded. $(document).ready(function hideAll() { //$('.stepText').hide(); $('.step1').addClass('hiddenstep'); $('.step2').addClass('hiddenstep'); $('.step3').addClass('hiddenstep'); $('.step4').addClass('hiddenstep'); $('.step5').addClass('hiddenstep'); $('.step6').addClass('hiddenstep'); $('.step7').addClass('hiddenstep'); $('.step8').addClass('hiddenstep'); $('.step9').addClass('hiddenstep'); $('.step10').addClass('hiddenstep'); $('.step1').click(function(){ $('.step1').removeClass('hiddenstep'); $('.step2').addClass('hiddenstep'); $('.step3').addClass('hiddenstep'); $('.step4').addClass('hiddenstep'); $('.step5').addClass('hiddenstep'); $('.step6').addClass('hiddenstep'); $('.step7').addClass('hiddenstep'); $('.step8').addClass('hiddenstep'); $('.step9').addClass('hiddenstep'); $('.step10').addClass('hiddenstep'); }); $('.step2').click(function(){ $('.step1').addClass('hiddenstep'); $('.step2').removeClass('hiddenstep'); $('.step3').addClass('hiddenstep'); $('.step4').addClass('hiddenstep'); $('.step5').addClass('hiddenstep'); $('.step6').addClass('hiddenstep'); $('.step7').addClass('hiddenstep'); $('.step8').addClass('hiddenstep'); $('.step9').addClass('hiddenstep'); $('.step10').addClass('hiddenstep'); }); $('.step3').click(function(){ $('.step1').addClass('hiddenstep'); $('.step2').addClass('hiddenstep'); $('.step3').removeClass('hiddenstep'); $('.step4').addClass('hiddenstep'); $('.step5').addClass('hiddenstep'); $('.step6').addClass('hiddenstep'); $('.step7').addClass('hiddenstep'); $('.step8').addClass('hiddenstep'); $('.step9').addClass('hiddenstep'); $('.step10').addClass('hiddenstep'); }); $('.step4').click(function(){ $('.step1').addClass('hiddenstep'); $('.step2').addClass('hiddenstep'); $('.step3').addClass('hiddenstep'); $('.step4').removeClass('hiddenstep'); $('.step5').addClass('hiddenstep'); $('.step6').addClass('hiddenstep'); $('.step7').addClass('hiddenstep'); $('.step8').addClass('hiddenstep'); $('.step9').addClass('hiddenstep'); $('.step10').addClass('hiddenstep'); }); $('.step5').click(function(){ $('.step1').addClass('hiddenstep'); $('.step2').addClass('hiddenstep'); $('.step3').addClass('hiddenstep'); $('.step4').addClass('hiddenstep'); $('.step5').removeClass('hiddenstep'); $('.step6').addClass('hiddenstep'); $('.step7').addClass('hiddenstep'); $('.step8').addClass('hiddenstep'); $('.step9').addClass('hiddenstep'); $('.step10').addClass('hiddenstep'); }); $('.step6').click(function(){ $('.step1').addClass('hiddenstep'); $('.step2').addClass('hiddenstep'); $('.step3').addClass('hiddenstep'); $('.step4').addClass('hiddenstep'); $('.step5').addClass('hiddenstep'); $('.step6').removeClass('hiddenstep'); $('.step7').addClass('hiddenstep'); $('.step8').addClass('hiddenstep'); $('.step9').addClass('hiddenstep'); $('.step10').addClass('hiddenstep'); }); $('.step7').click(function(){ $('.step1').addClass('hiddenstep'); $('.step2').addClass('hiddenstep');
[jQuery] Re: Executing javascript that comes inside an AJAX response
If you're going to use jQuery, you have to be careful about writing code that then doesn't use jQuery. In this case, you're ajax call would have worked fine, if you had stuck with injecting the response into the DOM with jQuery, as it automatically evals scripts in a response with dataType of 'html'. Change: contentDiv.innerHTML = data to (with the appropriate selector for your div): $('div').html(data); On Mar 24, 3:44 am, Amit Shah amitsh...@gmail.com wrote: it's not working. well eval(responseText); don't works. cells = divResult.getElementsByTagName(script); alert(cells.length); for (var i = 0; i cells.length; i++) { alert(cells[i].innerHTML); eval(cells[i].innerHTML); } sometesting(5); is working. but when the function sometesting() being called somewhere from ajaxresponse text, browser gives error. both ie and firefox. On Mar 15, 7:47 am, NightWatchman rushi...@gmail.com wrote: To execute javascript code returned by the server you need to use the javascript eval function on the string of script returned from the server. As far as I know changing the content of a div to a javascript block won't cause that javascript code to execute. I think you need to change: contentDiv.innerHTML = data; to eval(data); On Mar 14, 3:12 pm, Foreigner foreigne...@gmail.com wrote: Hi, I'm trying to use jQuery to get some HTML with Javascript using AJAX. My response gets inserted into the contentDiv element but my javascript inside the response doesn't get executed as the documentation says (http://docs.jquery.com/ Specifying_the_Data_Type_for_AJAX_Requests). Here goes my function with AJAX call: function loadHtml(obj) { if(obj.className == menuItem) { $.ajax({ type:GET, url:content/ + obj.id + .html, dataType: html, success: function(data, status) { contentDiv.innerHTML = data; } }); } } My response looks like: h3Some heading/h3 script type=text/javascript //Some javascript code /script
[jQuery] updating content (adding new items)
Hello. I have a simple twitter shoutbox on my website that I would like to refresh with jquery each X seconds. At the moment I use the following code which will hide the block, load new and show it: function getTweets() { $(#twitts).fadeOut(fast); $(#twitts).load(last-10-twitts.php, '', callback); } function callback() { $(#twitts).fadeIn(fast); setTimeout(getTweets();, 15000); } $(document).ready(getTweets); I'm looking for more advanced method that will only add new items at the beginning of the list. How is it possible to implement that? Is there any tutorial/example online? Many thanks in advance.
[jQuery] Half star rating plugin query | looking curvalue:3.5 to show 3 and half stars by default
Hi All, Just a quick question related to Ritesh star plugin which suits our need. Can we have curvalue:3.5 to show 3 and half stars out of 5 in rating ('', {maxvalue:5, curvalue:3.5}); Just wanted to show half star instead of increment value, which we have right now in this plugin. Not worried about hover and all, just wanted to show the star rating so not looking for any other advance star rating plugin to show the stars. Quick help should be appreciated. Thanks Mohammed Arif
[jQuery] New jQuery DomBuilder with Chain Functionality and JSON Style
I just released a first milestone of HSJN, the Html Snippet Javascript Notation system for storing HTML snippets in a JSON-esque format. The parser is a straightforward jQuery DOM Builder, with support for custom attributes, styles, and neatest of all, jQuery chains. (Yup, you can put jQuery function calls inside of HTML snippets, meaning you can put in one simple object an entire jQuery Tabs widget!) Check the project out here: http://code.google.com/p/hsjn/ I'd love to hear some feedback on it!
[jQuery] Re: Newbie Question: get id from A tag
ok, got it. thanx weidc, On Mar 24, 9:44 pm, weidc mueller.juli...@googlemail.com wrote: $(.clickme).attr(id); On 24 Mrz., 14:03, Jesse cdrp...@gmail.com wrote: Hello, I am not good at js. I want to get the id from A tag. E.g. a href=/comment.php class=clickme id=1234link/a I need the value 1234 from the code above, but dont know how to do it. Please help. Thanks.
[jQuery] Re: Validation plugin: combine functions with strings on remote error
You shouldn't then use the message-callback for this functionality. Take a look at the highlight-option instead. Jörn On Tue, Mar 24, 2009 at 3:35 PM, Andy Matthews li...@commadelimited.com wrote: Okay... Another question. I'm having an odd issue with the message area of the plugin, specifically with remote methods. When the remove method fires, as in my original post. The problem is that I want to do some additional error display when the error fires. Problem is that the message key appears to be getting triggered whether there's an error fired or not. For example, I'm checking to see if a key exists in the database. If it does, the message should be displayed, AND the fom field containing the key should have it's background color changed. The problem is that the background color changes whether the msg is displayed or not. Is this a bug, or intended behaviour? Here's my code to this point. messages: { pagealias: { required: 'Page alias is required', remote: function(){ // also highlight the field containing the error $field.pulse({ backgroundColors: ['#fff','#ea7f1e'] }).bind('focus', function(){ $(this).recover(); }); return 'This page alias is already in use'; } } } andy From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Jörn Zaefferer Sent: Monday, March 23, 2009 5:34 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Validation plugin: combine functions with strings on remote error Passing a function as a message happens all the time when using $.format(... {0}) as messages. The function is expected to return the formated message, so you can just return the string value you want to display at the end of your function. Jörn On Mon, Mar 23, 2009 at 10:39 PM, Andy Matthews amatth...@dealerskins.com wrote: I'm using the validation plugin to validate a field remotely. The validation portion works great, but I've got a question about the error message if the validation fails. I discovered that you can pass a function rather than a plain string as seen below in the remote key. The problem is that when I do this, I lose the ability to display a string of my choosing. Does anyone know how to accomplish both? messages: { pagealias: { required: 'Page alias is required', remote: function(){ // highlight the field $field.pulse(); // display message 'This page alias is already in use' } } } Andy Matthews Senior Web Developer www.dealerskins.com P Please consider the environment before printing this e-mail. Total customer satisfaction is my number 1 priority! If you are not completely satisfied with the service I have provided, please let me know right away so I can correct the problem, or notify my manager Aaron West at aw...@dealerskins.com.
[jQuery] Re: Changing the ID of a cloned table row
The add table row is being added with: pa href=# onclick=addTableRow('#table-1'); return false;Add New/a/p No, your code does not work for me. It's exactly the same as the code I've been trying since last night, so no offense -- why would it work? ;) My problem here is that the id is not changing -- if you read what I wrote, I mentioned that I can see in the generated source that it is not changing. That's all that I need. Once that happens, the sortable stuff should work as well. On Mar 24, 5:31 am, Karl Swedberg k...@englishrules.com wrote: Hi again, I don't see where you're actually calling the addTableRow function. Also, did you look at the demo I put together for you? Did that one work for you? Sometimes it helps to start simple and build up in order to see where the problem is occurring. Which browser are you testing in? Also, if the drag and drop stuff isn't being applied to the newly appended row, the problem could be unrelated to the row's ID. See these FAQs for details: http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_st...http://docs.jquery.com/Frequently_Asked_Questions#Why_doesn.27t_an_ev... --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Mar 24, 2009, at 1:37 AM, rivkadr wrote: I don't know why I need true in the function. I just copied the code from elsewhere ;) I am NOT a jquery (this is my first time using it) or JS expert, so am just trying to cobble something together for a work project, which is due by tomorrow. I'm using this:http://www.isocra.com/2008/02/table-drag-and-drop-jquery-plugin/ to allow the table rows to be sortable. I was originally using the id's for the tr tags that he had listed there in his example (i.e. just numbers), but changed them to tr1, tr2, and so on just now, since you say that numbers are not valid IDs . Doing that makes no difference -- if I add a new row to the table, and try to change the id, so that it will have an id different than the cloned row (and thereby, hopefully be sortable), it just isn't happening. (if I use a tool that lets me view the generated source, I can see that the ID has not changed) My Current code: javascript code jQuery(document).ready(function() { jQuery('#table-1').tableDnD({ onDrop: function(table, row) { //alert(jQuery('#table-1').tableDnDSerialize()); }, dragHandle: dragHandle }); jQuery(#table-1 tr).hover(function() { jQuery(this.cells[0]).addClass('showDragHandle'); }, function() { jQuery(this.cells[0]).removeClass('showDragHandle'); }); }); function addTableRow(table) { var clonedRow = jQuery(table + tr:last).clone().attr({ id: 'tr13' }) ; jQuery(table).append(clonedRow); return true; } / my html table id=table-1 cellspacing=0 cellpadding=2tr id=tr1td class=dragHandle width=16nbsp;nbsp;/td td select id=athlete_ids[] name=athlete_ids[] class=pull- down option value=0None/option option value=9, chris/option option value=517, Willow/option /select /td /tr . . . (duplicated multiple times, with tr2, tr3, and so on as the ids) /table My specific test example has 12 rows in it. I'm trying to add the 13th row (hence why tr13 is currently hardcoded. I'll worry later about trying to figure out how many rows there are in the table. I just want to get the darn id to change, so I can sort any added rows!) On Mar 23, 7:48 pm, Karl Swedberg k...@englishrules.com wrote: A few things: 1. Why do you need return true in the function? 2. 13 is not a valid ID, 3. you should probably be appending the row to a tbody, not the table. Nevertheless, I just tried your first function and it seemed to work fine for me: http://jsbin.com/ideju/edit Does that work for you? --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Mar 23, 2009, at 10:11 PM, rivkadr wrote: Am getting bloody from beating my head against the wall. I just want to be able to change the id of a table row that is cloned and appended to a table. This shouldn't be so hard, no? Here's what I've tried: function addTableRow(table) { var clonedRow = jQuery(table + tr:last).clone().attr({ id: '13' }) ; jQuery(table).append(clonedRow); return true; } OR function addTableRow(table) { var clonedRow = jQuery(table + tr:last).clone(); jQuery(clonedRow).attr(id, 13); //yes, I want the id to be 13 jQuery(table).append(clonedRow); return true; } Neither of the above works. Anyone got any help they can give me, please?
[jQuery] Re: Reusing script
I would add one common class to to all your .step1, ..., .step10 elements in your mark-up, and then do this: // say the common class is step $(document).ready(function() { var $steps = $('.step'); $steps .addClass('hiddenStep') .click( function() { $steps.addClass('hiddenStep'); $(this).removeClass('hiddenStep'); } ); } On Mar 24, 10:47 am, phelyer paulhel...@gmail.com wrote: Hi, I am using JQuery to show and hide sections of text within my page. The page has 10 sections of thext and 10 links. I want to initially hide all 10 sections of text, and then show section 3 when the link for section 3 is clicked, but make sure any previously shown sections are then hidden. Here is what I have used so far which dies wxactly what I want but seems very long winded. $(document).ready(function hideAll() { //$('.stepText').hide(); $('.step1').addClass('hiddenstep'); $('.step2').addClass('hiddenstep'); $('.step3').addClass('hiddenstep'); $('.step4').addClass('hiddenstep'); $('.step5').addClass('hiddenstep'); $('.step6').addClass('hiddenstep'); $('.step7').addClass('hiddenstep'); $('.step8').addClass('hiddenstep'); $('.step9').addClass('hiddenstep'); $('.step10').addClass('hiddenstep'); $('.step1').click(function(){ $('.step1').removeClass('hiddenstep'); $('.step2').addClass('hiddenstep'); $('.step3').addClass('hiddenstep'); $('.step4').addClass('hiddenstep'); $('.step5').addClass('hiddenstep'); $('.step6').addClass('hiddenstep'); $('.step7').addClass('hiddenstep'); $('.step8').addClass('hiddenstep'); $('.step9').addClass('hiddenstep'); $('.step10').addClass('hiddenstep'); }); $('.step2').click(function(){ $('.step1').addClass('hiddenstep'); $('.step2').removeClass('hiddenstep'); $('.step3').addClass('hiddenstep'); $('.step4').addClass('hiddenstep'); $('.step5').addClass('hiddenstep'); $('.step6').addClass('hiddenstep'); $('.step7').addClass('hiddenstep'); $('.step8').addClass('hiddenstep'); $('.step9').addClass('hiddenstep'); $('.step10').addClass('hiddenstep'); }); $('.step3').click(function(){ $('.step1').addClass('hiddenstep'); $('.step2').addClass('hiddenstep'); $('.step3').removeClass('hiddenstep'); $('.step4').addClass('hiddenstep'); $('.step5').addClass('hiddenstep'); $('.step6').addClass('hiddenstep'); $('.step7').addClass('hiddenstep'); $('.step8').addClass('hiddenstep'); $('.step9').addClass('hiddenstep'); $('.step10').addClass('hiddenstep'); }); $('.step4').click(function(){ $('.step1').addClass('hiddenstep'); $('.step2').addClass('hiddenstep'); $('.step3').addClass('hiddenstep'); $('.step4').removeClass('hiddenstep'); $('.step5').addClass('hiddenstep'); $('.step6').addClass('hiddenstep'); $('.step7').addClass('hiddenstep'); $('.step8').addClass('hiddenstep'); $('.step9').addClass('hiddenstep'); $('.step10').addClass('hiddenstep'); }); $('.step5').click(function(){ $('.step1').addClass('hiddenstep'); $('.step2').addClass('hiddenstep'); $('.step3').addClass('hiddenstep'); $('.step4').addClass('hiddenstep'); $('.step5').removeClass('hiddenstep'); $('.step6').addClass('hiddenstep'); $('.step7').addClass('hiddenstep'); $('.step8').addClass('hiddenstep'); $('.step9').addClass('hiddenstep'); $('.step10').addClass('hiddenstep'); }); $('.step6').click(function(){ $('.step1').addClass('hiddenstep'); $('.step2').addClass('hiddenstep'); $('.step3').addClass('hiddenstep'); $('.step4').addClass('hiddenstep'); $('.step5').addClass('hiddenstep'); $('.step6').removeClass('hiddenstep'); $('.step7').addClass('hiddenstep'); $('.step8').addClass('hiddenstep'); $('.step9').addClass('hiddenstep'); $('.step10').addClass('hiddenstep'); }); $('.step7').click(function(){ $('.step1').addClass('hiddenstep');
[jQuery] Re: Wouldn't inArray() be more intuitive if called arrayPosition()?
Yeah, I agree with Mike521, if I were to stumble onto that function without any related documentation, I would assume it to return a boolean value as well. While I agree with the kill two birds with one stone argument against changing the actual function, indexOf seems to be a more intuitive function name while still remaining short in length (shorter than arrayPosition). Although it may be more of a headache to change now, with the risk breaking innumerable plugins and pages. On Mar 23, 10:58 pm, Eric Garside gars...@gmail.com wrote: If you'd prefer shortcut functionality, try: $.isInArray = function(arr){ return $.inArray(arr) -1 ? true : false } On Mar 23, 4:59 pm, Klaus Hartl klaus.ha...@googlemail.com wrote: Read inArray as positionInArray rather than isInArray here... --Klaus On 23 Mrz., 21:25, MorningZ morni...@gmail.com wrote: Yeah, like what he is suggesting is to return a boolean value so now if someone wants the position of the item, it would be a whole separate function to do so to me, one single function and checking the value is more intuitive, maybe if it was named something more inline with what it returns (like for instance, indexOf) makes more sense, but none the less the function kills two birds with one stone On Mar 23, 4:19 pm, Eric Garside gars...@gmail.com wrote: Honestly, inArray and arrayPosition are equally intuitive to me. If the value has a position in the array, then it is, by definition, in the array. inArray returning the array position is a similar check, but with a more robust ouput. Again, as MorningZ said, you can simply check it's value using a simple gt operator. I honestly don't care too much about inArray returning a non-boolean value which may be unintuitive to some users. After all, the docs are there for a reason. On Mar 23, 3:51 pm, Mike521 mi...@favorfavor.com wrote: I'm not discussing whether I can or can't use it the way it is, I'm discussing which way is more intuitive. On Mar 23, 3:18 pm, MorningZ morni...@gmail.com wrote: just can't say if ($.inArray(value, array) -1) { // found in array? } On Mar 23, 2:59 pm, Mike521 mi...@favorfavor.com wrote: I was about to use inArray (http://docs.jquery.com/Utilities/ jQuery.inArray) to determine if an element was in an array or not, but I realized I can't use it as a true/false response since it returns the position (and could return 0 if the element was found in position 0 - returns -1 if not found). I was expecting something with the same functionality as the PHP function in_array (http://us3.php.net/ in_array) I know it's a minor point but wouldn't it be more intuitive if called arrayPosition? with a name like that I'd expect the functionality it has now.
[jQuery] Re: Wouldn't inArray() be more intuitive if called arrayPosition()?
Yea, the backwards compatibility is really the major issue with making a basically cosmetic change. On Mar 24, 12:04 pm, benjamw benjamwel...@gmail.com wrote: Yeah, I agree with Mike521, if I were to stumble onto that function without any related documentation, I would assume it to return a boolean value as well. While I agree with the kill two birds with one stone argument against changing the actual function, indexOf seems to be a more intuitive function name while still remaining short in length (shorter than arrayPosition). Although it may be more of a headache to change now, with the risk breaking innumerable plugins and pages. On Mar 23, 10:58 pm, Eric Garside gars...@gmail.com wrote: If you'd prefer shortcut functionality, try: $.isInArray = function(arr){ return $.inArray(arr) -1 ? true : false } On Mar 23, 4:59 pm, Klaus Hartl klaus.ha...@googlemail.com wrote: Read inArray as positionInArray rather than isInArray here... --Klaus On 23 Mrz., 21:25, MorningZ morni...@gmail.com wrote: Yeah, like what he is suggesting is to return a boolean value so now if someone wants the position of the item, it would be a whole separate function to do so to me, one single function and checking the value is more intuitive, maybe if it was named something more inline with what it returns (like for instance, indexOf) makes more sense, but none the less the function kills two birds with one stone On Mar 23, 4:19 pm, Eric Garside gars...@gmail.com wrote: Honestly, inArray and arrayPosition are equally intuitive to me. If the value has a position in the array, then it is, by definition, in the array. inArray returning the array position is a similar check, but with a more robust ouput. Again, as MorningZ said, you can simply check it's value using a simple gt operator. I honestly don't care too much about inArray returning a non-boolean value which may be unintuitive to some users. After all, the docs are there for a reason. On Mar 23, 3:51 pm, Mike521 mi...@favorfavor.com wrote: I'm not discussing whether I can or can't use it the way it is, I'm discussing which way is more intuitive. On Mar 23, 3:18 pm, MorningZ morni...@gmail.com wrote: just can't say if ($.inArray(value, array) -1) { // found in array? } On Mar 23, 2:59 pm, Mike521 mi...@favorfavor.com wrote: I was about to use inArray (http://docs.jquery.com/Utilities/ jQuery.inArray) to determine if an element was in an array or not, but I realized I can't use it as a true/false response since it returns the position (and could return 0 if the element was found in position 0 - returns -1 if not found). I was expecting something with the same functionality as the PHP function in_array (http://us3.php.net/ in_array) I know it's a minor point but wouldn't it be more intuitive if called arrayPosition? with a name like that I'd expect the functionality it has now.
[jQuery] Jbind/JQuery With Safari browser
Hi, I have an Aspx page in which I'm using JQuery. I'm perticularly using jBind plug in of JQuery for binding data to the template. I have 4 divs in to my solution. Out of 4, 2 Divs are bound to templates and rendered as per the template. This solution works very fine with IE 7.0 and Firefox, but when it comes to Safari, I could not see the Divs that are bound to templates. Is there any thing I need to do to render those in safari. Is there a jQuery and jBind support for Safari?
[jQuery] Re: Validate plugin not working
I had a eureka moment last night, when i stumbled into that solution.. didn't see any mention of it in the docs though..
[jQuery] Re: Changing the ID of a cloned table row
On Mar 24, 2009, at 11:44 AM, rivkadr wrote: The add table row is being added with: pa href=# onclick=addTableRow('#table-1'); return false;Add New/a/p ok. No, your code does not work for me. It's exactly the same as the code I've been trying since last night, so no offense -- why would it work? ;) umm. because it worked fine for me, as I already mentioned. If you open http://jsbin.com/ideju/ in Firefox and look at the last row, which was appended using the addTableRow function, in Firebug, you'll see the ID (13). My problem here is that the id is not changing -- if you read what I wrote, I mentioned that I can see in the generated source that it is not changing. Really? Are you seriously questioning whether I read what you wrote? I'm volunteering my time trying to help you, and you think it's somehow appropriate to insult me? In particular, I read this: Doing that makes no difference -- if I add a new row to the table, and try to change the id, so that it will have an id different than the cloned row (and thereby, hopefully be sortable), it just isn't happening. ... and I was responding to the hopefully be sortable part. Depending on how the dragndrop plugin is written, the ID change may be the least of your problems. That's all that I need. Once that happens, the sortable stuff should work as well. Maybe. Maybe not. If you'd like me to help you further, let me know which browser you're testing this in so I can try to replicate it in the same environment. --Karl
[jQuery] Re: Validate plugin not working
I've added anothe paragraph: http://docs.jquery.com/Plugins/Validation/Reference#Markup_recommendations Also, when you enable the debug-option, a warning is logged for every input that doesn't have a name-attribute. Jörn On Tue, Mar 24, 2009 at 5:56 PM, Brendon G. brendon.glee...@gmail.com wrote: I had a eureka moment last night, when i stumbled into that solution.. didn't see any mention of it in the docs though..
[jQuery] Re: Validation plugin: combine functions with strings on remote error
Man, you thought of everything. Thank you. -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Jörn Zaefferer Sent: Tuesday, March 24, 2009 10:42 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Validation plugin: combine functions with strings on remote error You shouldn't then use the message-callback for this functionality. Take a look at the highlight-option instead. Jörn On Tue, Mar 24, 2009 at 3:35 PM, Andy Matthews li...@commadelimited.com wrote: Okay... Another question. I'm having an odd issue with the message area of the plugin, specifically with remote methods. When the remove method fires, as in my original post. The problem is that I want to do some additional error display when the error fires. Problem is that the message key appears to be getting triggered whether there's an error fired or not. For example, I'm checking to see if a key exists in the database. If it does, the message should be displayed, AND the fom field containing the key should have it's background color changed. The problem is that the background color changes whether the msg is displayed or not. Is this a bug, or intended behaviour? Here's my code to this point. messages: { pagealias: { required: 'Page alias is required', remote: function(){ // also highlight the field containing the error $field.pulse({ backgroundColors: ['#fff','#ea7f1e'] }).bind('focus', function(){ $(this).recover(); }); return 'This page alias is already in use'; } } } andy From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Jörn Zaefferer Sent: Monday, March 23, 2009 5:34 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Validation plugin: combine functions with strings on remote error Passing a function as a message happens all the time when using $.format(... {0}) as messages. The function is expected to return the formated message, so you can just return the string value you want to display at the end of your function. Jörn On Mon, Mar 23, 2009 at 10:39 PM, Andy Matthews amatth...@dealerskins.com wrote: I'm using the validation plugin to validate a field remotely. The validation portion works great, but I've got a question about the error message if the validation fails. I discovered that you can pass a function rather than a plain string as seen below in the remote key. The problem is that when I do this, I lose the ability to display a string of my choosing. Does anyone know how to accomplish both? messages: { pagealias: { required: 'Page alias is required', remote: function(){ // highlight the field $field.pulse(); // display message 'This page alias is already in use' } } } Andy Matthews Senior Web Developer www.dealerskins.com P Please consider the environment before printing this e-mail. Total customer satisfaction is my number 1 priority! If you are not completely satisfied with the service I have provided, please let me know right away so I can correct the problem, or notify my manager Aaron West at aw...@dealerskins.com.
[jQuery] Re: Very slow find
From: Martin Tiršel I need to hold some things in memory for later use, so pure html is not ideal. I will try JSON, if it will be under 5-7 seconds for 500 items, it should be ok. In fact, you can get it much faster than that, even in IE. Let's assume your JSON data is an exact mirror of the XML: { pages: [ { name: the name, id: 5, url: http://example.com/;, author: { id: 7, name: the author }, languages: [ sk, cz ] }, { // another page }, { // ... } ] } and assume you have a reference to this data in a variable called json. You can write: $(#content_window_pages).append( makeTable(json.pages) ); function makeTable( pages ) { var html = [], h = -1; html[++h] = 'table class=pagelist'; html[++h] = 'theadtr'; html[++h] = 'thName/th'; html[++h] = 'thAuthor/th'; html[++h] = 'thLanguages/th'; html[++h] = 'thActions/th'; html[++h] = '/tr/thead'; html[++h] = 'tbody'; for( var page, i = -1; page = pages[++i]; ) { html[++h] = 'trtd class=first'; html[++h] = page.name; html[++h] = '/tdtd class=second'; html[++h] = page.author.name; html[++h] = '/tdtd class=third'; html[++h] = page.languages.join(); html[++h] = '/tdtd class=fourthnbsp;/td/tr'; } html[++h] = '/tbody'; html[++h] = '/table'; return html.join(''); } I think you will be very pleased with the speed of this code. And it's much simpler than the XML version too. The html[++h] = business is a bit ugly, but it's by far the fastest way to build up a long string in IE, and since IE is both the most widespread browser and the slowest at this, it's the one you need to worry about. I broke up the thead section into multiple html[++h] = assignments just to keep the line length short in this message, but you could combine those into one as in your original code if you prefer. It's not performance critical so it's just a matter of taste. For the code *inside* the inner loop I combined assignments as much as possible, as in the last line of the inner loop. -Mike
[jQuery] Convert js to jquery
Hi, I am trying to convert the below js code to jQuery format, since I am using jQuery for my site. Posted below the code, your help is appreciated. http://woork.blogspot.com/2008/01/tabbed-search-bar-using-css-and.html -- script language=javascript function setSearchOptions(idElement){ /* Total Tabs above the input field (in this case there are 2 tabs: mikode, user id) */ tot_tab = 2; tab = document.getElementById('tab'+idElement); search_option = document.getElementById('searchopt'); for(i=1; i=2; i++){ if(i==idElement){ tab.setAttribute(class,selected); search_option.value=idElement; } else { document.getElementById('tab'+i).setAttribute(class,); } } } /script div class=in_nobg ul class=search-options li id=tab2a href=# onclick=javascript:setSearchOptions (2);User ID/a/li li id=tab1 class=selecteda href=# onclick=javascript:setSearchOptions(1);mikode/a/li li id=tab0spanSearch Contact by/span/li /ul div id=search-bar form id=form1 name=form1 method=post action= input name= type=text class=search-input id=searchq size=40/ input name=Go type=button value=Go class=search-button / input type=hidden name=searchopt id=searchopt / /form /div -- Thank you!
[jQuery] Re: Wouldn't inArray() be more intuitive if called arrayPosition()?
Or the name could be changed for jQuery 1.4 and a plugin provided for the compatibility with 1.3 code. It has been the jQuery policy for some time now. On Mar 24, 5:25 pm, Eric Garside gars...@gmail.com wrote: Yea, the backwards compatibility is really the major issue with making a basically cosmetic change. On Mar 24, 12:04 pm, benjamw benjamwel...@gmail.com wrote: Yeah, I agree with Mike521, if I were to stumble onto that function without any related documentation, I would assume it to return a boolean value as well. While I agree with the kill two birds with one stone argument against changing the actual function, indexOf seems to be a more intuitive function name while still remaining short in length (shorter than arrayPosition). Although it may be more of a headache to change now, with the risk breaking innumerable plugins and pages. On Mar 23, 10:58 pm, Eric Garside gars...@gmail.com wrote: If you'd prefer shortcut functionality, try: $.isInArray = function(arr){ return $.inArray(arr) -1 ? true : false } On Mar 23, 4:59 pm, Klaus Hartl klaus.ha...@googlemail.com wrote: Read inArray as positionInArray rather than isInArray here... --Klaus On 23 Mrz., 21:25, MorningZ morni...@gmail.com wrote: Yeah, like what he is suggesting is to return a boolean value so now if someone wants the position of the item, it would be a whole separate function to do so to me, one single function and checking the value is more intuitive, maybe if it was named something more inline with what it returns (like for instance, indexOf) makes more sense, but none the less the function kills two birds with one stone On Mar 23, 4:19 pm, Eric Garside gars...@gmail.com wrote: Honestly, inArray and arrayPosition are equally intuitive to me. If the value has a position in the array, then it is, by definition, in the array. inArray returning the array position is a similar check, but with a more robust ouput. Again, as MorningZ said, you can simply check it's value using a simple gt operator. I honestly don't care too much about inArray returning a non-boolean value which may be unintuitive to some users. After all, the docs are there for a reason. On Mar 23, 3:51 pm, Mike521 mi...@favorfavor.com wrote: I'm not discussing whether I can or can't use it the way it is, I'm discussing which way is more intuitive. On Mar 23, 3:18 pm, MorningZ morni...@gmail.com wrote: just can't say if ($.inArray(value, array) -1) { // found in array? } On Mar 23, 2:59 pm, Mike521 mi...@favorfavor.com wrote: I was about to use inArray (http://docs.jquery.com/Utilities/ jQuery.inArray) to determine if an element was in an array or not, but I realized I can't use it as a true/false response since it returns the position (and could return 0 if the element was found in position 0 - returns -1 if not found). I was expecting something with the same functionality as the PHP function in_array (http://us3.php.net/ in_array) I know it's a minor point but wouldn't it be more intuitive if called arrayPosition? with a name like that I'd expect the functionality it has now.
[jQuery] Re: General question regarding speed
I assume you're talking about returning data via AJAX? Returning HTML is probably the fastest if all you're doing is just inserting the HTML into the DOM. However, returning JSON gives you a lot more flexibility if you actually want to do something with the returned data, such as client- side calculations, formatting, parsing error statuses, or dropping data into different parts of the DOM (not just in one place), etc. I personally favored the JSON route even if I were merely just dropping in data on the page since it sort of keeps the HTML out of the server-side scripting (as that's usually the source of my AJAX responses.) I'd rather have HTML inside my JavaScript coding than in my server-side (e.g. PHP, ASP) coding. On Mar 24, 3:36 am, finco mbeck...@gmail.com wrote: I am trying to figure the best way to maximize performance with data returned from ASP pages. Option one - return data in an HTML table. Let the host page's css format the table. Option two - return json data from the asp page and let the browser drop the data into a table and still let the host page do the final formatting. I guess the question is where the faster/least amount of processing time and transport of data is used. Other items of note - the application is an intranet where all users will have javascript enabled. Your collective wisdom is greatly appreciated.
[jQuery] Re: Changing the ID of a cloned table row
Do you have a live example of the code? Karl's stuff works fine for me, so I suspect it has something to do with other scripts on your page. On Mar 24, 12:56 pm, Karl Swedberg k...@englishrules.com wrote: On Mar 24, 2009, at 11:44 AM, rivkadr wrote: The add table row is being added with: pa href=# onclick=addTableRow('#table-1'); return false;Add New/a/p ok. No, your code does not work for me. It's exactly the same as the code I've been trying since last night, so no offense -- why would it work? ;) umm. because it worked fine for me, as I already mentioned. If you openhttp://jsbin.com/ideju/in Firefox and look at the last row, which was appended using the addTableRow function, in Firebug, you'll see the ID (13). My problem here is that the id is not changing -- if you read what I wrote, I mentioned that I can see in the generated source that it is not changing. Really? Are you seriously questioning whether I read what you wrote? I'm volunteering my time trying to help you, and you think it's somehow appropriate to insult me? In particular, I read this: Doing that makes no difference -- if I add a new row to the table, and try to change the id, so that it will have an id different than the cloned row (and thereby, hopefully be sortable), it just isn't happening. ... and I was responding to the hopefully be sortable part. Depending on how the dragndrop plugin is written, the ID change may be the least of your problems. That's all that I need. Once that happens, the sortable stuff should work as well. Maybe. Maybe not. If you'd like me to help you further, let me know which browser you're testing this in so I can try to replicate it in the same environment. --Karl
[jQuery] Re: General question regarding speed
Additionally, since you said its for your Intranet, you probably wouldn't have much lag so I think speed either way. JSON would probably have less data being transferred, but more overhead on the client-side to process the data. HTML would have more data being transferred, but less processing if all you're doing is just dropping in the HTML. Of course all of this depends on how much data is being returned. On Mar 24, 8:21 am, James james.gp@gmail.com wrote: I assume you're talking about returning data via AJAX? Returning HTML is probably the fastest if all you're doing is just inserting the HTML into the DOM. However, returning JSON gives you a lot more flexibility if you actually want to do something with the returned data, such as client- side calculations, formatting, parsing error statuses, or dropping data into different parts of the DOM (not just in one place), etc. I personally favored the JSON route even if I were merely just dropping in data on the page since it sort of keeps the HTML out of the server-side scripting (as that's usually the source of my AJAX responses.) I'd rather have HTML inside my JavaScript coding than in my server-side (e.g. PHP, ASP) coding. On Mar 24, 3:36 am, finco mbeck...@gmail.com wrote: I am trying to figure the best way to maximize performance with data returned from ASP pages. Option one - return data in an HTML table. Let the host page's css format the table. Option two - return json data from the asp page and let the browser drop the data into a table and still let the host page do the final formatting. I guess the question is where the faster/least amount of processing time and transport of data is used. Other items of note - the application is an intranet where all users will have javascript enabled. Your collective wisdom is greatly appreciated.
[jQuery] Re: Keeping jquery codes up to date - best practise?
I think the idea is that if many sites used the Google hosted script, and your visitor happened to visit one of them, it's probably already in their browser cache, so your site will have one less file to load. Google has servers all over the world, so it's unlikely the service will be down, but it is possible I guess. Also, because of that, the browser might also fetch a closer file for the visitor's location (thus, quicker download). Additionally, since it's loading from Google's server, it doesn't use your bandwidth. On Mar 23, 10:18 pm, Microbe xxxmicrobe...@gmail.com wrote: Yup, I hear ya all and now understand the issue. Especially Sam's point that upgrading automatically may break a function somewhere. Thanks so much for the replies. Much appreciated. I guess the last question is is there any advantage in linking to the google hosted scripts rather than hosting them myself? Doesn't this leave the possibility that if google's server is down my site breaks. Whereas if my server is down for some reason, well...it is ALL down.
[jQuery] modify pagination plugin to support ability to input page
I need a paginator similar to pagination for tablesorter or jqGrid where a user can input the page number they want to view. Issue is that the data is not in a table, so I cannot use these plugins. Ideally I'm wondering if anyone has found a way to modify the pagination plugin http://d-scribe.de/webtools/jquery-pagination/demo/demo_options.htm to support this. I am able to get it to display the current page in an input field but i cannot figure out how to get it to paginate to an inputed page number. Thanks -- View this message in context: http://www.nabble.com/modify-pagination-plugin-to-support-ability-to-input-page-tp22686978s27240p22686978.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: data is posted only once
It seems that when you click a link, it's re-adding all the page links again. When you bind the click to the page links initially, and you remove them, the new links will not inherit the click event. You'll have to re-bind the click events again, or better yet, use jQuery's live() function in place of click(). http://docs.jquery.com/Events/live On Mar 24, 1:20 am, Balázs Buri gazb...@gmail.com wrote: no, didnt solve it. :( I uploaded it, so u can see it and get a closer look. http://193.6.52.132/ajaxsender/ 2009/3/24 Steven Yang kenshin...@gmail.com how about try setting cache:false?
[jQuery] Re: data is posted only once
:) thanks. it works just fine. 2009/3/24 James james.gp@gmail.com It seems that when you click a link, it's re-adding all the page links again. When you bind the click to the page links initially, and you remove them, the new links will not inherit the click event. You'll have to re-bind the click events again, or better yet, use jQuery's live() function in place of click(). http://docs.jquery.com/Events/live On Mar 24, 1:20 am, Balázs Buri gazb...@gmail.com wrote: no, didnt solve it. :( I uploaded it, so u can see it and get a closer look. http://193.6.52.132/ajaxsender/ 2009/3/24 Steven Yang kenshin...@gmail.com how about try setting cache:false?
[jQuery] Re: modify pagination plugin to support ability to input page
Claudes, I put together a pretty straightforward little Pagination plugin. I don't have a download package or documentation up yet, but you can fetch the jquery.pagination.js plugin from here: svn checkout http://jquery-curator.googlecode.com/svn/trunk/ jquery- curator-read-only var paginators = $('.someSelector').pagination('mygroup', {pages: numOfPagesInSet}, function(group){ this; // The page the user changed to }); That code there will create a group of paginators in however many .someSelector elements you have. The selectors made into paginators through this call will remain grouped in the paginator logic. This allows you to, in one declaration, create a new pagination group over any number of elements that will keep itself updated as actions change. Now, you'll have to create the input box yourself, but the pagination library handles all outofbounding exceptions and face rendering. So by calling: paginators.pagination('force-change', 'mygroup', {current: $ ('#textField').val()}); you will trigger the paginators to render whatever current page you pass in, and fire the callback. If you need any help getting it to work, or have questions about any of the source, let me know. On Mar 24, 2:39 pm, claudes claudina.sar...@gmail.com wrote: I need a paginator similar to pagination for tablesorter or jqGrid where a user can input the page number they want to view. Issue is that the data is not in a table, so I cannot use these plugins. Ideally I'm wondering if anyone has found a way to modify the pagination pluginhttp://d-scribe.de/webtools/jquery-pagination/demo/demo_options.htm to support this. I am able to get it to display the current page in an input field but i cannot figure out how to get it to paginate to an inputed page number. Thanks -- View this message in context:http://www.nabble.com/modify-pagination-plugin-to-support-ability-to-... Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] cluetip plugin issues
I am trying to use the cluetip plugin to no avail. Instead of the cluetip coming up, I am taken to the website URL like a normal link. I am using this within the Liferay portal and am using the livequery plugin. I've tried this with ajaxCache set to false and true. The cluetip code is getting executed when the page loads - verified with firebug. Here is the cluetip related html that is written when the cluetip code executes: div id=cluetip-waitimage style=position: absolute; z-index: 95; display: none;/ div id=cluetip style=z-index: 96; display: none; position: absolute;div style=z-index: 90; opacity: 0.1; top: 6px; left: 6px; position: absolute; background-color: rgb(0, 0, 0);/div style=z- index: 91; opacity: 0.1; top: 5px; left: 5px; position: absolute; background-color: rgb(0, 0, 0);/div style=z-index: 92; opacity: 0.1; top: 4px; left: 4px; position: absolute; background-color: rgb(0, 0, 0);/div style=z-index: 93; opacity: 0.1; top: 3px; left: 3px; position: absolute; background-color: rgb(0, 0, 0);/div style=z- index: 94; opacity: 0.1; top: 2px; left: 2px; position: absolute; background-color: rgb(0, 0, 0);/div style=z-index: 95; opacity: 0.1; top: 1px; left: 1px; position: absolute; background-color: rgb(0, 0, 0);/div id=cluetip-outer style=position: relative; z-index: 97;h3 id=cluetip-title/div id=cluetip-inner//divdiv id=cluetip-extra/div class=cluetip-arrows id=cluetip-arrows style=z-index: 97;//div Here is my relevant code: jQuery(a.hTip).livequery(function() { jQuery(this).cluetip(); }); a href=someurl class=hTip title=the titleTest Me/a
[jQuery] Re: General question regarding speed
Thanks for your thoughts. I have datasets of varying sizes from a few rows to several thousand. I do appreciate the flexibility that returning json gives me on the client side although I've done lots of server side manipulation in the past. Intuitively, this seems to mix apples and oranges though. Thanks again for your thoughts on the matter. On Mar 24, 2:24 pm, James james.gp@gmail.com wrote: Additionally, since you said its for your Intranet, you probably wouldn't have much lag so I think speed either way. JSON would probably have less data being transferred, but more overhead on the client-side to process the data. HTML would have more data being transferred, but less processing if all you're doing is just dropping in the HTML. Of course all of this depends on how much data is being returned. On Mar 24, 8:21 am, James james.gp@gmail.com wrote: I assume you're talking about returning data via AJAX? Returning HTML is probably the fastest if all you're doing is just inserting the HTML into the DOM. However, returning JSON gives you a lot more flexibility if you actually want to do something with the returned data, such as client- side calculations, formatting, parsing error statuses, or dropping data into different parts of the DOM (not just in one place), etc. I personally favored the JSON route even if I were merely just dropping in data on the page since it sort of keeps the HTML out of the server-side scripting (as that's usually the source of my AJAX responses.) I'd rather have HTML inside my JavaScript coding than in my server-side (e.g. PHP, ASP) coding. On Mar 24, 3:36 am, finco mbeck...@gmail.com wrote: I am trying to figure the best way to maximize performance with data returned from ASP pages. Option one - return data in an HTML table. Let the host page's css format the table. Option two - return json data from the asp page and let the browser drop the data into a table and still let the host page do the final formatting. I guess the question is where the faster/least amount of processing time and transport of data is used. Other items of note - the application is an intranet where all users will have javascript enabled. Your collective wisdom is greatly appreciated.
[jQuery] Re: Keeping jquery codes up to date - best practise?
To build on James reply Using more CDNs allow your user's browser to download more simultaneously http://developer.yahoo.com/performance/rules.html#cdn On Mar 24, 2:33 pm, James james.gp@gmail.com wrote: I think the idea is that if many sites used the Google hosted script, and your visitor happened to visit one of them, it's probably already in their browser cache, so your site will have one less file to load. Google has servers all over the world, so it's unlikely the service will be down, but it is possible I guess. Also, because of that, the browser might also fetch a closer file for the visitor's location (thus, quicker download). Additionally, since it's loading from Google's server, it doesn't use your bandwidth. On Mar 23, 10:18 pm, Microbe xxxmicrobe...@gmail.com wrote: Yup, I hear ya all and now understand the issue. Especially Sam's point that upgrading automatically may break a function somewhere. Thanks so much for the replies. Much appreciated. I guess the last question is is there any advantage in linking to the google hosted scripts rather than hosting them myself? Doesn't this leave the possibility that if google's server is down my site breaks. Whereas if my server is down for some reason, well...it is ALL down.
[jQuery] Re: Rotating CSS classes each 5 sec
Hey guys. Thanks for all your help, i am not very proeficient in Javascript (jQuery) and i really appreciate you taking your time to explain stuff. I found it very useful. Best Regards AlexD --- Alexandru Dinulescu Web Developer (X)HTML/CSS Specialist Expert Guarantee Certified Developer XHTML: http://www.expertrating.com/transcript.asp?transcriptid=1879053 CSS : http://www.expertrating.com/transcript.asp?transcriptid=1870619 RentACoder Profile: http://www.rentacoder.com/RentACoder/DotNet/SoftwareCoders/ShowBioInfo.aspx?lngAuthorId=6995323 MainWebsite: http://alexd.adore.ro On Mon, Mar 23, 2009 at 2:05 PM, RobG rg...@iinet.net.au wrote: On Mar 23, 2:33 pm, mkmanning michaell...@gmail.com wrote: Presumably, which points out a recurring problem: because we don't know the OP's intended use, vis-à-vis actual markup and CSS, etc. everything we suggest is somewhat academic. Other suggestions proposed iterating over collections of elements, I was pointing out an alternative. There's a tradeoff with modifying style rules vs. using class names. If you find yourself having to alter too many styles, it can become cumbersome and more Naturally, the intention is not to iterate over anything and simply modify a single rule. prone to errors It is no more error prone than any other method. (and your presentation layer is now beginning to pollute your behavior layer). Not necessarily. The values to be altered can themselves be encapsulated in css rules accessed by class - instead of iterating over some collection of elements with the same class, you swap the rules of one class for those of another. Class names allow you to roll up several styles into one 'package' as well as take advantage of CSS hierarchy (which you could use e.g. to affect the results of the js modification to the style). Which is not precluded by altering style rules, it is just a different approach. For the OP's situation, i.e. changing a background image, it might be even more efficient to use a sprite-- a single image (so you'd only have a single http request), and re-position the image on each rotation. That could be done in the JavaScript as you suggest, but I'd still prefer to abstract it to classes rather than have to keep position information in the js: Moving an image within an element with overflow hidden can be achieved either way. The style data does not have to be hard coded in the script, it only needs to be passed parameters that tell it which rules to replace with which other rules, that can be all the rules of class A with all the rules of class B (or similar). .img1,.img2, .img3,.img4,.img5 { background-image:#fff url(some_image_url) 0 0 no-repeat;} .img2{ background-position:0 100px;} .img3{ background-image:50px 0;} etc... .theDisplayedRule {} now just write the rules in .imgN to .theDisplayedRule and any element with class theDisplayedRule will get the changes. Since it's presentational, That is not precluded by swapping rules, it depends on how it is implemented. [...] I think the fact that everybody has a different approach makes it very interesting though; I hope the OP can see at least that there are many ways to come at the same problem. Yes. -- Rob
[jQuery] Re: Very slow find
Thanks very much, this way it takes 2 seconds (with load and rendering), what is better I was expecting On this project, I totally ignore IE (I am using some newer technologies available only in normal browsers), it is not a common website but a web-based application for a specific group of users. Martin On Tue, 24 Mar 2009 18:29:33 +0100, Michael Geary m...@mg.to wrote: From: Martin Tiršel I need to hold some things in memory for later use, so pure html is not ideal. I will try JSON, if it will be under 5-7 seconds for 500 items, it should be ok. In fact, you can get it much faster than that, even in IE. Let's assume your JSON data is an exact mirror of the XML: { pages: [ { name: the name, id: 5, url: http://example.com/;, author: { id: 7, name: the author }, languages: [ sk, cz ] }, { // another page }, { // ... } ] } and assume you have a reference to this data in a variable called json. You can write: $(#content_window_pages).append( makeTable(json.pages) ); function makeTable( pages ) { var html = [], h = -1; html[++h] = 'table class=pagelist'; html[++h] = 'theadtr'; html[++h] = 'thName/th'; html[++h] = 'thAuthor/th'; html[++h] = 'thLanguages/th'; html[++h] = 'thActions/th'; html[++h] = '/tr/thead'; html[++h] = 'tbody'; for( var page, i = -1; page = pages[++i]; ) { html[++h] = 'trtd class=first'; html[++h] = page.name; html[++h] = '/tdtd class=second'; html[++h] = page.author.name; html[++h] = '/tdtd class=third'; html[++h] = page.languages.join(); html[++h] = '/tdtd class=fourthnbsp;/td/tr'; } html[++h] = '/tbody'; html[++h] = '/table'; return html.join(''); } I think you will be very pleased with the speed of this code. And it's much simpler than the XML version too. The html[++h] = business is a bit ugly, but it's by far the fastest way to build up a long string in IE, and since IE is both the most widespread browser and the slowest at this, it's the one you need to worry about. I broke up the thead section into multiple html[++h] = assignments just to keep the line length short in this message, but you could combine those into one as in your original code if you prefer. It's not performance critical so it's just a matter of taste. For the code *inside* the inner loop I combined assignments as much as possible, as in the last line of the inner loop. -Mike
[jQuery] Need public JavaScript resource for a $.getScript() request.
I am experimenting $.getScript() jQuery function. There are tons of JSON public API's but I need find a public JavaScript script. I seached Google sure, but scripts found have their own request codes. I need see that function in action and I want developer my own jQuery request. Does anyone can point me out a resource where I encounter this kind of remote requested file? -- View this message in context: http://www.nabble.com/Need-public-JavaScript-resource-for-a-%24.getScript%28%29-request.-tp22689019s27240p22689019.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Dynamic update div tag; javascript fails for complex data
Hello, Need help. I want to dynamically update the contents of my div tag. Therefore I used jquery and the code is as follows $data= 'welcome to this page'; $(#element1).html($data); This code works perfectly fine for simple data. But for complex data say, $data = 'Hey welcome to webpage, 'Enjoy''; $(#element1).html($data); doesnt work because the javascript fails. Is there any jquery plugin that checks to see if the content in $data is valid. Thank you, Ramya
[jQuery] jQuery Success on form submit not working?
Hi all - I cannot seem to get this success piece to work, the script will go through and validate each field of my contact form and prompt the user to enter in required data etc... Hit the submit button and I get my email notification however; the success function does not display. Anyone know why? Js.setup.util.editable({title: Key in the custom value}); var contactBox = window.contactBox = { contact: { task: function() { var node = jQuery(#contact_type); var child = jQuery(#show-if-corporate); var task = function() { if (node.val() == Corporate) { child.slideDown(); } else { child.slideUp(); } }; node.bind(change, function() { task(); }); task(); }, success: function(text) { jQuery(#contact-form).slideUp(); jQuery(h3/).text(Thank You).appendTo(#col_670); jQuery(p/).text(I will get back to you shortly.).appendTo (#col_670); } } } jQuery(function() { new Js.util.editable(#contact_subject); new Js.util.editable(#contact_task); new Js.util.editable(#contact_type); new Js.util.editable(#contact_budget, { prefix: $ }); contactBox.contact.task(); new Js.util.formSubmit({ id: #contact-form, url: contact_me.php, option: { onError: function(){ alert(Please fill in all required fields (marked by *)); } } }); });
[jQuery] JQuery
jQuery (English) jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. jQuery is designed to change the way that you write JavaScript. @ http://www.organismsgenome.webs.com/ @
[jQuery] 2 Sliders working together.
Friends, I have two sliders on the page. One at the top right, and one at the bottom right. I would like for them to work together. When one slider opens the other one closes. http://sucro.se/red7e/BE/ Any ideas? Daniel
[jQuery] Cycle plugin questions
Hey all, Using the (awesome) Cycle plugin all over the place, and I have a question: in the uncompressed code file [1], a comment says that the second argument to .cycle() can be the name of an fx (only used in conjunction with a numeric value for 'options'). I've tried this (to trigger a manual transition to a specific slide, with a specific transition effect), and the second argument doesn't appear to have any effect; the transition defined in the original options is always used. Is the comment wrong, and what I'm trying to do currently not possible? Or am I doing something wrong? Thanks in advance for any help! Carl [1] http://malsup.com/jquery/cycle/jquery.cycle.all.js?v2.60
[jQuery] 2 Sliders working together.
Friends, I have two sliders on the page. One at the top right, and one at the bottom right. I would like for them to work together. When one slider opens the other one closes. http://sucro.se/red7e/BE/ Any ideas? Daniel -- View this message in context: http://www.nabble.com/2-Sliders-working-together.-tp22688635s27240p22688635.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Superfish Not working
I am using Epic as my template and can not get superfish to work. It keeps pulling a Dark Blue lettering for the menu items and some of them are white. I need help as I have beta testers checking the site and this is the only problem I am having. I am scheduled to launch the site April 1st. Please let meknow if you can help me. Site - www.gstcbsa.org/Council. You should see that some of the items are in Dark Blue and Some in white. I can see it this way in FF and IE 7
[jQuery] superfish bg images - almost there!
hello, first off, amazing! thank you for your great work. most every part is working for me, including using background images. when the mouse hovers, the background image changes as does the text color. perfect. currently, i only have the superfish menu on the Discounts link so that is the link i am speaking of. (as should be obvious when looking at the menu, i'm using blank background images with actual link text on top of them). after the hover menu flys out and i begin to hover over the fly out menu, the parent link Discounts text color reverts back to its original color. the background image stays just like it should though. i've tried everything i can think of up to and including using js to force the text color to stick but without success. any help would be greatly appreciated especially since i will be in big trouble with a client if i can't get it working. mr. birch, your code is flawless but i've updated the css file to better reflect how i understand css. i hope you'll be able to make sense of it. here's the site for testing: http://www.y11k.com/superfish/ css: http://www.y11k.com/superfish/css/superfish.css (the menu css is below the other sections. ignore the other stuff... it's pasted from the live site and most of it isn't being used in the html) js: http://www.y11k.com/superfish/js/superfish.js http://www.y11k.com/superfish/js/initialize.js (file i use to initialize superfish... rather than calling from the html) thank you very much in advance! -d
[jQuery] Superfish: automatically expand 3rd-level menu?
I have a 3-level menu using JQuery-Superfish. I would like to hover over the top-level menu item and have BOTH the 2nd and 3rd-level menus open automatically. Any ideas?
[jQuery] Cross-browser inline style injection in DOM
Hello all jQuery people. This is my first post in this list but I hope I can make sense with my question. Currently I'm developing some web applications for internal use, porting some old ones. I'd love the jQuery-way to do asynchronous requests, so I developed a plugin similar to Pimentech jFrame. Basicly, it automagically catches all clicks on links, sends an AJAH request and loads the response inside a container. The problem came when the response contains STYLE or LINK tags. Using Firefox and Opera all was perfect, but no style was applied with IE6, IE7, Chrome or Safari. I was thinking that was my plugin's fault, but when I test the use case without it, the problem remains. No style applied. Check this simplified case without even jQuery: body p id=testThis is a test and should have a border around and 1ex padding!/p script type=text/javascript var div = document.createElement('div'); // br/ added to avoid a bug in IE div.innerHTML = 'br /style#test { border:2px solid #000; padding: 1ex; }/style'; var span = div.getElementsByTagName('span')[0]; document.body.appendChild(div); /script /body I thought that jQuery have workarounds to this, but I found none, so I created a plugin to do the work. In case I missed some jQuery functionality, please tell me. I prefer the jQuery way. This plugin relies on detecting whether inlined styles are processed or not. If not, modify $.fn.html to move all style's and link's to document.head, mark them with a 'data-style-loader' attribute and adding a dummy link to the target. When te dummy link is removed (with the same $.fn.html function), it removes all related style's and link's from head. Well, that's the code: $(function($) { // Checks for some supported features (function() { var div = document.createElement('div'); div.id = 'jquery-support-styled'; document.body.appendChild(div); // Checks whether inlined styles applies automaticly (Firefox and Opera returns true) div.innerHTML = 'style#'+div.id+' span { display:block; width: 3px; }/stylespan /'; var span = div.getElementsByTagName('span')[0]; $.support.inlineStyleApplies = $(span).width() == 3; // Checks whether inlined styles applies if they are inside 'br' context (for IE) $.support.mustPrependBrToInlineStyles = ! $.support.inlineStyleApplies (function(){ div.innerHTML = 'br /style#'+div.id+' span { display:block; width:5px; }/stylespan /'; var span = div.getElementsByTagName('span')[0]; return ($.support.inlineStyleApplies = $(span).width() == 5); })(); document.body.removeChild(div); })(); // Saves old $().html function var old_html = $.fn.html; if($.support.mustPrependBrToInlineStyles) { // Modify old $().html to add br before styles and links $.fn.html = function(_value) { if(typeof _value !== 'string') { _value = _value.replace(/style|link/gi, function(_text) { return 'br style=display:none/'+_text }) } return old_html.call(this, _value); } } else if(!$.support.inlineStyleApplies) { // Change old $().html to move link´s and style´s to the head $.fn.html = function(_text) { // Remove css-pointers and their pointees var $styles = this.find('link[data-style-loader]'); if($styles.length) { clean_css($styles); } // Calls old $().html old_html.call(this, _text); // Promote new links and styles to document.head $styles = this.find('style,link[rel*=stylesheet]'); if($styles.length) { add_styles.call(this, $styles) } return this; } // Remove css-pointers and their pointees functionclean_css(_$styles) { // Get pointees id var st = []; for(var i = 0; i _$styles.length; ++i) { st[st.length] = '[data-style-loader='+$(_$styles[i]).attr('data- style-loader')+']' } // Remove all links pointed $('head').find(st.join(', ')).remove(); } // Promote new links and styles to document.head functionadd_styles(_$styles) { // Selects a
[jQuery] creating search page with click for more results.
OK - let me please preface this by the fact that I am now 12 hours into jQuery, with a pretty basic Javascript understanding, and years of PHP work. I could not find the answer to my questions, mostly because I don't exactly know how to frame them! I am creating a search with expandable results. The search part I have down just fine, I have a form submit button that executes a .load function that drops the search results to a div. So far so good - this works wonders. Now, what I am trying to accomplish and cannot, is for a linked item in that returned data, to then show/hide additional data passed through to it in a hidden div. So my javascript is this: $(document).ready(function(){ $(#sboid).click(function(){ $(#search_results).load(ajax.html,{order_id:$('#orderid').val (),action:digital_search}); }); $(#vieworderdata).click(function() { $(#order_logs).show(slow); }); }); The return from the ajax.html page would be something like: div id='dlorder' span id='orderid'a href='#' id='vieworderdata'1234/a/span span id='orderdate'2009-03-24/span span id='name'4456 - widget/span div style='display: none' id='order_logs' span id='access_key'Access Key: absdcef/span div id='log' span id='log_date'2009-03-24 10:00:02/span span id='log_ip'0.0.0.0/span span id='disk_no'Disk Number: 1/span /div /div /div That gets returned into the div id='search_results'/div in the starting HTML page. So, when I click on the a href in the returned data, in theory, that hidden block will be displayed. Not happening. I am not sure if I am not accessing it properly in the javascript above, or if it is not working because it was not a part of the original page DOM, and cannot be accessed? Further to this, once THAT is working, there is an issue that there may be MANY results returned, and how to reference the a href that was clicked, to the hidden div to be displayed. I can easily return different div names, appending a running count to them (vieworderdata1, vieworderdata2, vieworderdata3, etc), but how to create the javascript code to say the one I clicked on here is the div hidden just below it... TIA for your help, and please go easy on a noob ;)
[jQuery] jQuery validation and captcha
dear all, i'm working with jQuery validation to validate the fields in a form. in this form i have also the captcha (the check is verified through ajax). check the code below: jQuery.validator.addMethod(Captcha, function(value, element) { jQuery.get(/captcha.asp?validateCaptchaCode= + jQuery (#captchacode).val() + , function(data){ if (data == 1) { result = true; } return true; }); return this.required(element) || true; });
[jQuery] Multiple lists that should only show x amount of items until you expand them
OK, this is what I have. Multiple lists that I can collapse and expand. What I want is for them to only show x amount of items until I expand them. Say x = 2 In Section A the following would be shown Link A-A Link A-B In Section B the following would be shown Link B-A Link B-B etc. And when I push a Section link it will show all html head script type=text/javascript src=jquery.js/script script type=text/javascript $(document).ready(function() { $(#menu li a[class=expanded] + ul).slideToggle(medium); $(#menu li a).click(function() { $(this).toggleClass(expanded).toggleClass(collapsed).find(+ ul).slideToggle(medium); }); }); /script /head body ul id=menu lia class=expandedSection A/a ul lia href=#Link A-A/a/li lia href=#Link A-B/a/li lia href=#Link A-C/a/li lia href=#Link A-D/a/li /ul /li lia class=expandedSection B/a ul lia href=#Link B-A/a/li lia href=#Link B-B/a/li lia href=#Link B-C/a/li lia href=#Link B-D/a/li /ul /li lia class=expandedSection C/a ul lia href=#Link C-A/a/li lia href=#Link C-B/a/li lia href=#Link C-C/a/li lia href=#Link C-D/a/li /ul /li /ul /body /html
[jQuery] Superfish: automatically expand 3rd-level menu?
Hello, I have a 3-level menu using Superfish. I would like to hover over the top-level menu item and have BOTH the 2nd and 3rd-level menus open automatically. Any ideas? Thanks in advance! Jon
[jQuery] jQuery validation and captcha in a form
dear all, i'm trying to implement the captcha in a form where i'm using jquery validation and also custom validation methods. this is the code i have so far: jQuery.validator.addMethod(Captcha, Function(value, element) { jQuery.get(/functions/app/CaptchaAjax/captcha.asp? validateCaptchaCode= + jQuery(#captchacode).val() + , function (data){ if (data == 1) return true; }); return this.required(element) || true; }); the problem i have so far is that: if i get out from the jQuery.get function then i will loose the variable data and if i put the return this.required(element) || true; then i will get an error because the addmethod function needs it. is there i work around this? or may be another way to do it? Thanks
[jQuery] Delay function to wait for post
I have the following code: $('#r_0_0').blur(function() { var x = $('#r_0_0').val(); var y=#d_0; $(y).empty(); $.get(apps/P5001/call/LineItems.lasso?LITM= + x + Line= + 'r_0_0' + TEST= + y,function(data2){ $(y).empty(); $(y).append(data2); },html); $('#addnew').click(); }); The last line #addnew is adding a new line to a html table, and the other code is updating a div with information from a database call. It is all processing correctly, except the addnew is running before the database query. How can I get the addnew to wait for the prior commands to finish?
[jQuery] jQuery Tutorial
I'm just getting to know jQuery. The basic tutorial (http:// docs.jquery.com/Tutorials:How_jQuery_Works ) fails to mention that $ is used as a shortcut for jQuery. Things would have made much more sense the first time I read through it if this had been mentioned. I'm used to $ preceding a variable name as in PHP. A different use of $ was confusing and need not have been if it were explained in the first place. I offer this input that you might improve the tutorial. --Nathan Shaskin Compliance Publishing
[jQuery] dragable + sortable: modify cloned dragables on drop
I am kinda confused, and stranded. If i create dragables with clones and drag them into a connected sortable i can't find a way to get/interact with the objects clone. dragable: stop: function(event, ui) { ...} nothing in ui points at the clone.. sortable however doesn't seem to offer a way either... recieve: function(event, ui) { ...} again ui doesnt point at the clone anywhere.. :(
[jQuery] Wrapping p siblings following h1 in divs
Hi, I am new to jQuery, and it seems the very first thing I try to do gives me problems. However, probably I am missing something so let me ask you if you can hint me on the best way to accomplish this. I want to transform a document with a flat structure like this h1Heading 1/h1 pParagraph 1.1/p pParagraph 1.2/p h1Heading 2/h1 pParagraph 2.1/p pParagraph 2.2/p to something more hierarchical like this h1Heading 1/h1 div pParagraph 1.1/p pParagraph 1.2/p /div h1Heading 2/h1 div pParagraph 2.1/p pParagraph 2.2/p /div The biggest problem for me is to detect where the limit between the paragraphs (in the form of another heading) are. Unfortunately there is nothing distinctive about the p elements (no ids, no classes, this is generated code that I can not control) Thanks! /Claes
[jQuery] Two Sliders on Page :: 1 closes when the other opens
Friends, I have two sliders on the page. One at the top right, and one at the bottom right. I would like for them to work together. When one slider opens the other one closes. Daniel
[jQuery] Re: Delay function to wait for post
Add the {async:false} option to your $.get. This tells JavaScript to wait for the response before continuing with the rest of the script. By default, AJAX is asynchronous. On Mar 24, 4:13 am, aeg1s aeg1s1...@gmail.com wrote: I have the following code: $('#r_0_0').blur(function() { var x = $('#r_0_0').val(); var y=#d_0; $(y).empty(); $.get(apps/P5001/call/LineItems.lasso?LITM= + x + Line= + 'r_0_0' + TEST= + y,function(data2){ $(y).empty(); $(y).append(data2); },html); $('#addnew').click(); }); The last line #addnew is adding a new line to a html table, and the other code is updating a div with information from a database call. It is all processing correctly, except the addnew is running before the database query. How can I get the addnew to wait for the prior commands to finish?
[jQuery] Ticket: [1738-1124031702]
This message is to notify you that your ticket has been submitted. Ticket ID: 1738-1124031702 Message: -- Hello, Need help. I want to dynamically update the contents of my div tag. Therefore I used jquery and the code is as follows $data= 'welcome to this page'; $(#element1).html($data); This code works perfectly fine for simple data. But for complex data say, $data = 'Hey welcome to webpage, 'Enjoy''; $(#element1).html($data); doesnt work because the javascript fails. Is there any jquery plugin that checks to see if the content in $data is valid. Thank you, Ramya -- To check the status of this ticket, visit: http://www.infiniteskills.com/helpdesk/index.php?action=ticketid=MTczOC0xMTI0MDMxNzAyide=anF1ZXJ5LWVuQGdvb2dsZWdyb3Vwcy5jb20=
[jQuery] Ticket: [1739-8724031714]
This message is to notify you that your ticket has been submitted. Ticket ID: 1739-8724031714 Message: -- Friends, I have two sliders on the page. One at the top right, and one at the bottom right. I would like for them to work together. When one slider opens the other one closes. http://sucro.se/red7e/BE/ Any ideas? Daniel -- To check the status of this ticket, visit: http://www.infiniteskills.com/helpdesk/index.php?action=ticketid=MTczOS04NzI0MDMxNzE0ide=anF1ZXJ5LWVuQGdvb2dsZWdyb3Vwcy5jb20=
[jQuery] Ticket: [1741-5224031715]
This message is to notify you that your ticket has been submitted. Ticket ID: 1741-5224031715 Message: -- Hi all - I cannot seem to get this success piece to work, the script will go through and validate each field of my contact form and prompt the user to enter in required data etc... Hit the submit button and I get my email notification however; the success function does not display. Anyone know why? Js.setup.util.editable({title: Key in the custom value}); var contactBox = window.contactBox = { contact: { task: function() { var node = jQuery(#contact_type); var child = jQuery(#show-if-corporate); var task = function() { if (node.val() == Corporate) { child.slideDown(); } else { child.slideUp(); } }; node.bind(change, function() { task(); }); task(); }, success: function(text) { jQuery(#contact-form).slideUp(); jQuery(h3/).text(Thank You).appendTo(#col_670); jQuery(p/).text(I will get back to you shortly.).appendTo (#col_670); } } } jQuery(function() { new Js.util.editable(#contact_subject); new Js.util.editable(#contact_task); new Js.util.editable(#contact_type); new Js.util.editable(#contact_budget, { prefix: $ }); contactBox.contact.task(); new Js.util.formSubmit({ id: #contact-form, url: contact_me.php, option: { onError: function(){ alert(Please fill in all required fields (marked by *)); } } }); }); -- To check the status of this ticket, visit: http://www.infiniteskills.com/helpdesk/index.php?action=ticketid=MTc0MS01MjI0MDMxNzE1ide=anF1ZXJ5LWVuQGdvb2dsZWdyb3Vwcy5jb20=
[jQuery] Ticket: [1740-3424031715]
This message is to notify you that your ticket has been submitted. Ticket ID: 1740-3424031715 Message: -- jQuery (English) jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. jQuery is designed to change the way that you write JavaScript. @ http://www.organismsgenome.webs.com/ @ -- To check the status of this ticket, visit: http://www.infiniteskills.com/helpdesk/index.php?action=ticketid=MTc0MC0zNDI0MDMxNzE1ide=anF1ZXJ5LWVuQGdvb2dsZWdyb3Vwcy5jb20=
[jQuery] Ticket: [1742-3924031723]
This message is to notify you that your ticket has been submitted. Ticket ID: 1742-3924031723 Message: -- Hey all, Using the (awesome) Cycle plugin all over the place, and I have a question: in the uncompressed code file [1], a comment says that the second argument to .cycle() can be the name of an fx (only used in conjunction with a numeric value for 'options'). I've tried this (to trigger a manual transition to a specific slide, with a specific transition effect), and the second argument doesn't appear to have any effect; the transition defined in the original options is always used. Is the comment wrong, and what I'm trying to do currently not possible? Or am I doing something wrong? Thanks in advance for any help! Carl [1] http://malsup.com/jquery/cycle/jquery.cycle.all.js?v2.60 -- To check the status of this ticket, visit: http://www.infiniteskills.com/helpdesk/index.php?action=ticketid=MTc0Mi0zOTI0MDMxNzIzide=anF1ZXJ5LWVuQGdvb2dsZWdyb3Vwcy5jb20=
[jQuery] Ticket: [1745-7924031743]
This message is to notify you that your ticket has been submitted. Ticket ID: 1745-7924031743 Message: -- I am using Epic as my template and can not get superfish to work. It keeps pulling a Dark Blue lettering for the menu items and some of them are white. I need help as I have beta testers checking the site and this is the only problem I am having. I am scheduled to launch the site April 1st. Please let meknow if you can help me. Site - www.gstcbsa.org/Council. You should see that some of the items are in Dark Blue and Some in white. I can see it this way in FF and IE 7 -- To check the status of this ticket, visit: http://www.infiniteskills.com/helpdesk/index.php?action=ticketid=MTc0NS03OTI0MDMxNzQzide=anF1ZXJ5LWVuQGdvb2dsZWdyb3Vwcy5jb20=