[jQuery] Re: JSON and each loop
Duh! Thank you. I tried that earlier, but i left the ".", "data. [selected_country]" and it would error out.
[jQuery] Re: Some problems with jQuery BlockUI Plugin
It worked! Now I realized that the plugin can show the hidhen element automatically, so I don't need to show or hide it by myself. Thanks! On Jun 6, 12:34 am, Mike Alsup <[EMAIL PROTECTED]> wrote: > > You need to remove this line: > > > $('#waitting').show(); > > You don't need this line either: > > $('#waitting').hide();
[jQuery] Datepicker: convert date string back to date?
Does anyone know if there is a way to convert datepicker's generated date range string back to a suitable date format I can use to provide values for minDate and maxDate? Thanks!
[jQuery] Re: JSON and each loop
> This is a working sample, but I would like to use a dynamic variable > "selected_country" within the each loop at the end. Like: > data.selected_country. However, if I use this it takes it literally > and thus does not find "selected_country" in the JSON. It would be > nice to find and only return US, UK, etc. from the JSON. Instead of data.US, just say data[selected_country] and it will pick the right one.
[jQuery] Re: Making normal functions work with jQuery
> So, my question is, how can I combine my functions that I already have > created, and have it work with jQuery, so that it can look for a > specific class, which contains the ISO date, and replace that? If you used markup like this: 2008-06-05T20:35Z You could replace the ISO dates with another format using this: $("span.ISODate").each(function(){ $(this).text(getTFID($(this).text())); });
[jQuery] Re: Reading http headers out of an ajax response
Um, just for the record, I did actually google various things, on more than one occasion.. On Thu, Jun 5, 2008 at 1:28 PM, sparkpool <[EMAIL PROTECTED]> wrote: > Doh, thanks. I was looking for properties, not methods. Foo on me. > > On Wed, Jun 4, 2008 at 7:42 PM, Karl Rudd <[EMAIL PROTECTED]> wrote: >> >> From a quick Google search I found >> (http://www.hunlock.com/blogs/AJAX_for_n00bs): >> >> # AJAX.getAllResponseHeaders() -- returns as a string all current >> headers in use. >> # AJAX.getResponseHeader("headerLabel") -- returns value of the >> requested header. >> >> Karl Rudd >> >> On Thu, Jun 5, 2008 at 9:32 AM, sparkpool <[EMAIL PROTECTED]> wrote: >>> >>> Sorry to be a pest, but any takers on this? Does anyone know if it's >>> possible at all in javascript? >>> >>> Thanks >>> >>> On Wed, Jun 4, 2008 at 7:21 AM, sparkpool <[EMAIL PROTECTED]> wrote: Hi all, I know that jquery's ajax calls set the X-Requested-With header to 'XMLHttpRequest' for ajax requests, making it really easy for the server side to detect them. Is there any way for jquery to read the http headers out an ajax response back from the server? I can see the ones I'm interested in in the firebug console, but when I dump the XMLHttpRequest object out from inside my ajax complete method, I don't see them anywhere. Does jquery provide any tools for this? Is it possible at all in javascript? Thanks >>> >> >
[jQuery] Re: jQuery allow encoding into json?
Woops, sorry, wrong direction. You want to produce a "string" version to stuff into the field. The method I suggested pulls it's data from a form into a JSON form (but not the "string" you're looking for). Try the "stringify" method from here: http://www.json.org/js.html Karl Rudd On Fri, Jun 6, 2008 at 10:15 AM, Mark <[EMAIL PROTECTED]> wrote: > > could not find a function for it. > > Will be creating a complicated js object on client side. Want to > encode that object into json, and stuff the value into a hidden form > field for POST. > > anybody help a nubie? >
[jQuery] Re: jQuery allow encoding into json?
*http://mg.to/2006/01/25/json-for-jquery http://www.mail-archive.com/[EMAIL PROTECTED]/msg06247.html the second is a port of the original from json.org, I use that for my JSON requests. * On Thu, Jun 5, 2008 at 5:15 PM, Mark <[EMAIL PROTECTED]> wrote: > > could not find a function for it. > > Will be creating a complicated js object on client side. Want to > encode that object into json, and stuff the value into a hidden form > field for POST. > > anybody help a nubie? > -- http://morglog.alleycatracing.com Lets make up more accronyms! http://www.alleycatracing.com LTABOTIIOFR! ROFL! ROFL! ROFL! Upcoming alley cats, reviews, touring logs, and a general congregation of bike nerdity.
[jQuery] Re: jQuery allow encoding into json?
> could not find a function for it. > > Will be creating a complicated js object on client side. Want to > encode that object into json, and stuff the value into a hidden form > field for POST. > > anybody help a nubie? Here's some links: http://jollytoad.googlepages.com/json.js http://www.overset.com/2008/04/11/mark-gibsons-json-jquery-updated/ http://code.google.com/p/jquery-json/
[jQuery] Re: Thickbox on 1.2.6 or best alternative?
Shane, Check out this one: http://leandrovieira.com/projects/jquery/lightbox/ Rey Shane Graber wrote: What are people using today to create effects like thickbox or lightbox on jQuery 1.2.6? Thickbox is broken on the 1.2.x release and I'm stuck with an old version of jQuery until I find a suitable replacement. What are others using?
[jQuery] jquery-1.2.6.pack.js broken?
Attempting to use jquery-1.2.6.pack.js linked from http://docs.jquery.com/Downloading_jQuery resulted in a lot of "$ is not defined" errors for me. The good news is using http://dean.edwards.name/packer/ to pack the uncompressed version ( jquery-1.2.6.js ) worked nicely. Perhaps a problem with the published packed version? Cheers Ollie
[jQuery] Re: jQuery allow encoding into json?
You want: http://docs.jquery.com/Ajax/serializeArray Karl Rudd On Fri, Jun 6, 2008 at 10:15 AM, Mark <[EMAIL PROTECTED]> wrote: > > could not find a function for it. > > Will be creating a complicated js object on client side. Want to > encode that object into json, and stuff the value into a hidden form > field for POST. > > anybody help a nubie? >
[jQuery] Re: click function doesn't work on dynamic content?
Take a look at: http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_Ajax_request.3F If I've understood you're problem, it's a fairly common one that stems from the fact that you're adding a new element (with append(' ...) that has no click event bound to it. The article linked above has a full explanation and some good solutions. - Richard Richard D. Worth http://rdworth.org/ On Thu, Jun 5, 2008 at 7:31 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi there, > > Please see my example here: http://www.hellobenlau.net/jquery/test.htm > > So basically, I want to select a list item from Group A, and when the > transfer button is clicked, it gets transfered to Group B. > However, once transferred, the list items in Group B doesn't respond > to any click function called OUTSIDE of the 'transfer' function. > > I"m not sure if i'm explaining it properly, but this is my code: > $(document).ready(function(){ > >var temp; > >// selecting >$('li').click(function(){ >$('li.highlight').removeClass('highlight'); >$(this).addClass('highlight'); >temp = $(this).text(); >}); > >// when transfer link is clicked >$('#transfer').click(function(){ >$('#groupA li.highlight').remove(); >$('#groupB').append('' + temp + ''); >}); >}); > > Any help would be extremely helpful! > > Thanks!! >
[jQuery] Re: String Manipulation
Errr JavaScript has a string split function: http://www.w3schools.com/jsref/jsref_split.asp Karl Rudd On Fri, Jun 6, 2008 at 9:50 AM, Mike <[EMAIL PROTECTED]> wrote: > > Is there a good string manipulation library plugin? Something that > might have .split() >
[jQuery] Re: Sorting Divs by Span Value
Wrap that html in a and try this code triggered by a button or link. function reorder(sortby, direction) { Array.prototype.sort.call($("div.hotel"), function(a,b){ var av = $(a).find("span."+sortby).text(); var bv = $(b).find("span."+sortby).text(); return direction=="ascending"? av-bv : bv-av; }).appendTo("#hotels"); } sortby is the class name of any of the spans like distance or rate; direction is "ascending" (low to high) or "descending". The code assumes the spans should always be sorted as numeric values. That code should be plenty fast for a dozen or so entries, but it would get slow for 100 because it requeries for the span values on each sort comparison.
[jQuery] Thickbox on 1.2.6 or best alternative?
What are people using today to create effects like thickbox or lightbox on jQuery 1.2.6? Thickbox is broken on the 1.2.x release and I'm stuck with an old version of jQuery until I find a suitable replacement. What are others using? -- Shane ∞ http://liquid.homelinux.org - I'm so cool I can be used to prove Bose-Einstein Condensation!
[jQuery] jQuery allow encoding into json?
could not find a function for it. Will be creating a complicated js object on client side. Want to encode that object into json, and stuff the value into a hidden form field for POST. anybody help a nubie?
[jQuery] Re: Trying to write a MacFF2 Transparency Fix - Need help with .version
You need that dollar sign, a la if ($.browser.mozilla && $.browser.version < 3.0) -- Josh - Original Message - From: <[EMAIL PROTECTED]> To: "jQuery (English)" Sent: Thursday, June 05, 2008 2:38 PM Subject: [jQuery] Trying to write a MacFF2 Transparency Fix - Need help with .version Here is my code: // Mac FireFox 2 Transparent Background Fix if ($.browser.mozilla && (browser.version < 3.0)) { $(function(){ alert('This is FireFox 2!'); $('body').css('background', 'red'); }); } I think that .version is blowing up the script. Can someone help me with what I am doing? Lemme know what I missed. Thanks. Dave
[jQuery] String Manipulation
Is there a good string manipulation library plugin? Something that might have .split()
[jQuery] click function doesn't work on dynamic content?
Hi there, Please see my example here: http://www.hellobenlau.net/jquery/test.htm So basically, I want to select a list item from Group A, and when the transfer button is clicked, it gets transfered to Group B. However, once transferred, the list items in Group B doesn't respond to any click function called OUTSIDE of the 'transfer' function. I"m not sure if i'm explaining it properly, but this is my code: $(document).ready(function(){ var temp; // selecting $('li').click(function(){ $('li.highlight').removeClass('highlight'); $(this).addClass('highlight'); temp = $(this).text(); }); // when transfer link is clicked $('#transfer').click(function(){ $('#groupA li.highlight').remove(); $('#groupB').append('' + temp + ''); }); }); Any help would be extremely helpful! Thanks!!
[jQuery] Making normal functions work with jQuery
I have two functions that convert an ISO date into whatever date format I want. Currently I am using a document.write statement to write out each date, but I don't want to do that anymore. I want to make it unobtrusive, and have jquery find a class selector, and replace the content. So, my question is, how can I combine my functions that I already have created, and have it work with jQuery, so that it can look for a specific class, which contains the ISO date, and replace that? Date.prototype.customFormat=function(formatString){ var ,YY,,MMM,MM,M,,DDD,DD,D,hhh,hh,h,mm,m,ss,s,ampm,dMod,th; YY = ((=this.getFullYear())+"").substr(2,2); MM = (M=this.getMonth()+1)<10?('0'+M):M; MMM = (=["January","February","March","April","May","June","July","August","September","October","November","December"] [M-1]).substr(0,3); DD = (D=this.getDate())<10?('0'+D):D; DDD = (=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"] [this.getDay()]).substr(0,3); th=(D>=10&&D<=20)?'th':((dMod=D%10)==1)?'st':(dMod==2)?'nd': (dMod==3)?'rd':'th'; formatString = formatString.replace("##",).replace("#YY#",YY).replace("##",).replace("#MMM#",MMM).replace("#MM#",MM).replace("#M#",M).replace("##",).replace("#DDD#",DDD).replace("#DD#",DD).replace("#D#",D).replace("#th#",th); h=(hhh=this.getHours()); if (h==0) h=24; if (h>12) h-=12; hh = h<10?('0'+h):h; ampm=hhh<12?'am':'pm'; mm=(m=this.getMinutes())<10?('0'+m):m; ss=(s=this.getSeconds())<10?('0'+s):s; return formatString.replace("#hhh#",hhh).replace("#hh#",hh).replace("#h#",h).replace("#mm#",mm).replace("#m#",m).replace("#ss#",ss).replace("#s#",s).replace("#ampm#",ampm); } getTFID=function(isoDate){ //GET TIME FROM ISO DATE if(isoDate.slice(-1)=='-') return ''; isoDate = isoDate.replace(/\D/g, " "); var dObj = isoDate.split(" "); var newDate = new Date(dObj[0], (dObj[1]-1), dObj[2], dObj[3], dObj[4], dObj[5]); return newDate.customFormat('#h#:#mm##ampm#');
[jQuery] JSON and each loop
This is a working sample, but I would like to use a dynamic variable "selected_country" within the each loop at the end. Like: data.selected_country. However, if I use this it takes it literally and thus does not find "selected_country" in the JSON. It would be nice to find and only return US, UK, etc. from the JSON. JS: var $select_country = $('select[name="country"]').get()[0]; var $select_state = $('select[name="state"]').get()[0]; var selected_country = 'US'; $($select_country).change(function() { selected_country = $select_country.value; }); $.getJSON('/portal/js/lib/state.json',function(data) { $.each(data.US, function(key,state) { $($select_state).append('' + state + ''); }); }); JSON: { 'US' : { 'AK' : 'Alaska', 'AL' : 'Alabama'}, 'CA' : {'AB' : 'Alberta', 'MB' : 'Manitoba'} } Any suggestions? Thanks.
[jQuery] Re: help with array for flot
aquaone thank you! I need to do a little reading up on what .push does rolf On Jun 5, 2008, at 3:09 PM, aquaone wrote: $('#plot').click(function() { var d1 = []; $('#curveData tbody tr').each(function() { tr = $(this); pair = []; tr.find('input.qty').val() && tr.find('input.price').val() && pair.push( tr.find('input.qty').val(), tr.find('input.price').val () ) && d1.push( pair ); }); $.plot($("#graphHolder"), [ { color: "#bb", data: d1, points: { show: true }, lines: { show: true } } ]); });
[jQuery] Re: help with array for flot
$('#plot').click(function() { var d1 = []; $('#curveData tbody tr').each(function() { tr = $(this); pair = []; tr.find('input.qty').val() && tr.find('input.price').val() && pair.push( tr.find('input.qty').val(), tr.find('input.price').val() ) && d1.push( pair ); }); $.plot($("#graphHolder"), [ { color: "#bb", data: d1, points: { show: true }, lines: { show: true } } ]); });
[jQuery] Trying to write a MacFF2 Transparency Fix - Need help with .version
Here is my code: // Mac FireFox 2 Transparent Background Fix if ($.browser.mozilla && (browser.version < 3.0)) { $(function(){ alert('This is FireFox 2!'); $('body').css('background', 'red'); }); } I think that .version is blowing up the script. Can someone help me with what I am doing? Lemme know what I missed. Thanks. Dave
[jQuery] Re: IE6 secure nonsecure warning
I just figured out that jquery.history_remote.pack.js is the file that seems to cause the warning message for me. When I take this jQuery plugin include file out, the message goes away. Any idea on how to fix this? I think it might have something to do with the iframe part of this plugin.
[jQuery] clueTip issue with jqueryUI
Hi, clueTips don't work with dialogs in jQueryUI. I just get regular title when I hover over the links. The code I am using for this is : HTML * "> : "> JAVASCRIPT = // Tooltips $('a.tp_tooltip').cluetip({ splitTitle: '|', showTitle: false, cluezIndex: 4000 }); I tried enabling tooltips after the dialogs are opened (in case the elements needed to be visible before it added clueTips to them) but that didn't work either. Should I add this to the bug tracker (if there is one)? Or, am I doing something wrong? Thanks in advance, Moazzam
[jQuery] Re: superfish help
Hi Joel-! ok - found another problem. http://lhc.lucidcrew.com/ministries the first and last menu items have no sub-nav, so on rollover, it highlights the "active" tab and pops its subnav open. how do I avoid this from happening?
[jQuery] IE6 secure nonsecure warning
Has anyone else noticed this on a site that uses jQuery or a jQuery plugin? IE7 and Firefox don't seem to complain, but IE6 does.
[jQuery] Re: Calendar Over Dialog
Tim, Are you using the css file that comes with the ui.datepicker? If so, make sure the section near the top looks like this: #datepicker_div { display: none; border: 1px solid #777; z-index: ; /*must have*/ } Note the z-index set to . Compare this to the z-index of your dialog. The datepicker's z-index should be a larger number than the dialog's z-index. HTH, Carl Tim Scott wrote: > Does anyone know if there is any combination of plugins that would > allow me to use a calendar control from inside a dialog? I have tried > all combinations of jQuery UI dialog and calendar, BlockUI, and jQuery > datePicker. > > The problem is, I guess, these calendars actually *are* modal dialogs > too, and they do not know how to go over top of an already active > dialog. Therefore they appear "underneath" the active dialog where > the user cannot see them. > > >
[jQuery] Calendar Over Dialog
Does anyone know if there is any combination of plugins that would allow me to use a calendar control from inside a dialog? I have tried all combinations of jQuery UI dialog and calendar, BlockUI, and jQuery datePicker. The problem is, I guess, these calendars actually *are* modal dialogs too, and they do not know how to go over top of an already active dialog. Therefore they appear "underneath" the active dialog where the user cannot see them.
[jQuery] Re: jQuery v1.2.6 is now Officially Released and Release Notes are Available
Ever more impressive. Well done you lot, you make us proud! George
[jQuery] Re: get Request doesnt work in IE7
Don't know if this is the problem, but you're missing a semicolon (;) after the end of your $.get function call. Carl Jan S wrote: > All of a sudden, xmlhttprequests don't work no more in IE7. FF > perfect, no problems. > Here the simple code: > www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > http://www.w3.org/1999/xhtml";> > > some title > > > script> >