[jQuery] Re: Managing scripts in AJAX applications

2009-04-11 Thread Jason Huck
On Apr 1, 1:39 pm, JMan jbeck...@gmail.com wrote: One thing I have been struggling with is AJAX applications is managing the js code that powers them. For example if you have a page that loads content from an AJAX call to the server and that content also has js code associated with it in

[jQuery] Re: Why is the behavior only attached to the first select?

2008-11-16 Thread Jason Huck
This line is the likely culprit, because the css selector is not specific to an individual select element: var selected = $(select option:selected).val(); Try this instead, to constrain the selection within the current context: var selected = $(option:selected, this).val(); Or,

[jQuery] Re: Its possible to do this??

2008-11-16 Thread Jason Huck
If you want to concatenate strings in order to create selectors, don't make them jQuery objects first. In other words, just do this: var row = .flexigrid .bDiv #socios .trSelected:first; $(row + td:first).css(color, red); Also, as long as your ID's are unique, which they should be,

[jQuery] Re: help with jquery add/remove class

2008-11-16 Thread Jason Huck
I would suggest dropping the add-/remove- class stuff entirely in favor of simply switching out the background image. Try something like this: // Attach a click event to every input in the .nav section. $('div.nav input').click(function(){ // Extract the specific floor plan from the

[jQuery] Re: descendants

2008-09-01 Thread Jason Huck
$(this).find('input[id*=mycheckname]:first'); http://docs.jquery.com/Traversing/find#expr - jason On Sep 1, 5:27 pm, matt knapp [EMAIL PROTECTED] wrote: I have some table rows: table tr class=tableRowtd/tdtd/tdtddivBlah divinput=checkbox id=mycheckname_4343/div/div/td tr

[jQuery] Re: Nesting if statements not working

2008-09-01 Thread Jason Huck
One thing I would suggest is casting the .val() as an integer before comparing it: var dulicateCheck = parseInt($(#duplicateInput).val()); Otherwise it's doing a string comparison, which will throw off your results. - jason On Sep 1, 9:25 pm, hubbs [EMAIL PROTECTED] wrote: For some

[jQuery] Re: Adding the dialog function dynamically to each li element

2008-06-17 Thread Jason Huck
I think, at a bare minimum, you'll want to change this: var title = $(this h3).val(); ...to this: var title = $('h3', this).text(); ...and this: $(this h3).append... ...to this: $('h3', this).append... I think that'll solve your immediate problem. - jason On Jun 17, 2:37 pm, Dan

[jQuery] Re: jQuery v1.2.6 is now Officially Released and Release Notes are Available

2008-06-03 Thread Jason Huck
This looks fantastic. Thanks to everyone on the team for their continued hard work. You guys rock! - jason On Jun 3, 1:46 pm, Rey Bango [EMAIL PROTECTED] wrote: jQuery v1.2.6 is now official and release notes have been posted:http://docs.jquery.com/Release:jQuery_1.2.6 The biggest

[jQuery] Re: reseting values of input fields that have been cloned

2008-06-02 Thread Jason Huck
I haven't tested this, but I think you'd just select the inputs within the clone, and reset them before inserting, like so: var clonedRow = $(tbody.gltb tr#guest_new).clone(); $('input', clonedRow).val(''); - jason On Jun 2, 11:42 am, jarp [EMAIL PROTECTED] wrote: new to jquery. here is

[jQuery] Re: Newbie Q: Insert last paragraph just before fourth paragraph?

2008-06-01 Thread Jason Huck
Here's one way, no last class required, though it probably could be improved upon: $($('p').get(3)).before($('p:last')); - jason On Jun 1, 9:02 am, swortis [EMAIL PROTECTED] wrote: Hi all- I suspect this is ridiculously easy.. but I'm lost.. I'm looking for a jquery way of taking the

[jQuery] Re: Grouping Definition list items

2008-05-27 Thread Jason Huck
Have you tried using .next() ? Something along these lines (untested): $('dd.comments input[type=radio]').toggle( function(){ $(this).next('dd.feedback').show(); }, function(){ $(this).next('dd.feedback').hide(); } }); - jason On May 27, 3:57 pm, macgregor [EMAIL PROTECTED] wrote: I

[jQuery] Re: [OT] twitter

2008-05-20 Thread Jason Huck
I've tried several, but always come back to Twitterific: http://iconfactory.com/software/twitterrific - jason (http://twitter.com/easykill)

[jQuery] Re: second time jquery is included, kills previously called plugins

2008-05-19 Thread Jason Huck
is already called before calling it again.  Of course, that last one would require that all developers do that, which may not happen.  It would be awesome if jquery itself would know that it's already been declared and not override itself if it was. On May 18, 7:42 pm, Jason Huck [EMAIL PROTECTED

[jQuery] [Validate] this[0] is undefined error

2008-05-16 Thread Jason Huck
I'm using Jörn's awesome Validate plugin and have accidentally broken something. I have two radio buttons in a fieldset like so: fieldset id=meta26group input id=meta26_3 class=required digits type=radio value=3 name=meta26/ label for=meta26_3Stuff/labelbr/ input id=meta26_5 class=required

[jQuery] Re: [Validate] this[0] is undefined error

2008-05-16 Thread Jason Huck
p.s., I was using a slightly older version of the plugin, but updating to the latest made no difference. The rest of the validation (and there's quite a bit of it) is all working just fine. - jason On May 16, 11:09 am, Jason Huck [EMAIL PROTECTED] wrote: I'm using Jörn's awesome Validate

[jQuery] Re: [Validate] this[0] is undefined error

2008-05-16 Thread Jason Huck
selected. So in your case, one of these two selectors seems to find nothing: $('.reqPC')  $('.reqPA') Jörn On Fri, May 16, 2008 at 5:34 PM, Jason Huck [EMAIL PROTECTED] wrote: p.s., I was using a slightly older version of the plugin, but updating to the latest made no difference. The rest

[jQuery] Re: $.post() not sending info

2008-05-16 Thread Jason Huck
If this code is verbatim, then I would say it's because your $.post() call does not include a submit param, which is what sendsuggest.php is checking for in order to process the submission. - jason On May 16, 7:59 pm, riscphree [EMAIL PROTECTED] wrote: I've got a suggestion form that inserts

[jQuery] Re: Dynamic forms and jQuery

2008-05-15 Thread Jason Huck
Here's an example I put together for someone a while back: http://devblog.jasonhuck.com/assets/infiniteformrows.html HTH, Jason On May 15, 3:13 pm, Spencer [EMAIL PROTECTED] wrote: I'm trying to create an order form where the user starts out with a single row of form inputs for entering

[jQuery] Re: trigger event on resize of window

2008-05-15 Thread Jason Huck
Yes, .resize(): html head script type=text/javascript src=http://cachefile.net/scripts/jquery/1.2.3/ jquery-1.2.3.min.js /script script type=text/javascript $(function(){

[jQuery] Re: How do I get post data to go with it?

2008-05-11 Thread Jason Huck
You're pretty close, but you don't need *both* $.post() and .load(). Just pick one or the other. Using .load() is a little bit simpler, but I believe it uses GET behind the scenes: script type=text/javascript $(function(){ $('#yourbutton').click(function(){

[jQuery] Re: Any plugin like this one, double select boxes ???

2008-05-08 Thread Jason Huck
Yes, here's one I wrote recently: http://devblog.jasonhuck.com/2008/04/25/jquery-combo-select-redux/ HTH, Jason On May 8, 3:28 pm, Vivek [EMAIL PROTECTED] wrote: Hi Guys, i am looking for an functionality in jquery. some thing like this one. Sometimes we see two big text boxes with

[jQuery] Re: event binding on dynamically created elements? stumped

2008-05-01 Thread Jason Huck
In this case, the simplest thing is probably to use .find() to discover the new element, i.e.: $(this) .after('input type=text name=symptom value=Enter Symptom class=focusClear /') .parent() .find('input.focusClear') .focus(function(){ $(this).val(''); }); - jason

[jQuery] Re: size of an ul

2008-04-30 Thread Jason Huck
$('ul').children().size(); - jason On Apr 30, 2:58 am, Ray Mckoy [EMAIL PROTECTED] wrote: Hi all. Can i know the number of li in a ul with jquery?. Thank you all.

[jQuery] Re: [ANNOUNCE] New Twitter Account for jQuery jQuery UI Projects

2008-04-30 Thread Jason Huck
Twitter posts (or tweets) are limited to 140 characters, so they're not going to replace full-fledged announcements. Rather, most of the time, they'll just be headlines with a URL which points to...you guessed it...the plugin repository, the main site, this list, various blogs, etc. So, I

[jQuery] Re: Moving label text to input

2008-04-30 Thread Jason Huck
All you should need to do is break the chain, since 'this' will still refer to the label until you're inside another function, making the call to .next() superfluous anyway. However, stuffing the id of the input you want to select into its own variable might be a tiny bit easier to read. Try

[jQuery] Re: How to make input type=text auto-expand when there's more text ?

2008-04-15 Thread Jason Huck
You could do something like this (needs a bit of tweaking): html head script type=text/javascript src=http://cachefile.net/scripts/jquery/1.2.3/ jquery-1.2.3.min.js /script script

[jQuery] Re: $(this) scope (each() nested in an event)

2008-04-03 Thread Jason Huck
You're pushing the value from each div into a generic array instead of the elements array, and adding a comma after each item as if you are concatenating a string. Also, you have a dollar sign in front of your alert(). Try something like this instead: $('.button').click(function(){ var

[jQuery] Re: Problem with parent('td').parent('tr').$('td').length

2008-04-01 Thread Jason Huck
Any of these should do the trick: $('#inp').parent().parent().find('td').size(); $('#inp').parents('tr').find('td').size(); $('#inp').parents('tr').children().size(); $('#inp').parent().siblings().size() + 1; - jason On Apr 1, 6:13 am, Emil Zegers [EMAIL PROTECTED] wrote: Hello, I have

[jQuery] Re: Changing the click trigger inside itself is causing undesired results.

2008-03-31 Thread Jason Huck
You're not doing anything in your code to remove the original click event. To make it work this way, you'd need to make a single recursive function using .unbind() to remove the first click event, add the second, and then on the second click, remove the second click and call itself again to

[jQuery] Re: first child of type form control

2008-03-27 Thread Jason Huck
Try this: $('#elHombre').next('form').children('input select textarea') [0].focus(); - jason On Mar 27, 6:32 am, Dug Falby [EMAIL PROTECTED] wrote: Hi guys, I've got: $('#elHombre').focus(); Which sets focus to a legend at the top of a form. I'd like to do:

[jQuery] Re: Waiting for a click event...

2008-03-25 Thread Jason Huck
Here is one way to do it based on the markup you've shown: html head style type=text/css div { display: none; } #no-1 { display: block; } /style script type=text/javascript

[jQuery] Re: Combine two jQuery objects

2008-03-24 Thread Jason Huck
I think you're looking for .add(). Try this: var childElmts = $('#P30_DESKTOP_ADD, label[for=P30_DESKTOP_ADD]'); if(prntElmtID != 'P30_DESKTOP') childElmts.add( $('#P30_LT_OPTIONS').parent('td').children() ); - jason On Mar 24, 11:43 am, Dan M [EMAIL PROTECTED] wrote: Hello all,

[jQuery] Re: Problems getting timing of commands to happen correctly

2008-03-24 Thread Jason Huck
You want to place each subsequent effect within the callback function of the previous effect, i.e.: $('YOUR_ITEM').EFFECT1(function(){ $(this).EFFECT2(function(){ $(this).EFFECT3(function(){ ...and so on... }); }); }); - jason On Mar 24, 12:25 pm, Steve

[jQuery] Re: How do you restore the defaultValue of select element after a change event?

2008-03-24 Thread Jason Huck
If your first option element has an empty value attribute, you can do this: $('select').change(function(){ alert($(this).val()); $(this).val(''); }); - jason On Mar 24, 2:16 pm, Ashley [EMAIL PROTECTED] wrote: I have a select which pops a modal (with blockUI) input when a

[jQuery] Re: How do you restore the defaultValue of select element after a change event?

2008-03-24 Thread Jason Huck
Oh, duh. You mean whatever their last selection was prior to the change. Sorry! Can you pop each successful update into a global var, and then restore from that when they cancel? - jason On Mar 24, 6:22 pm, Ashley [EMAIL PROTECTED] wrote: On Mar 24, 3:08 pm, Jason Huck [EMAIL PROTECTED

[jQuery] IE re-applies percentage widths on each event.

2008-03-24 Thread Jason Huck
Hi all, I'm trying to finish up a little plugin to create a sortable combo- select input from a single select input. It works great in Firefox, Safari, and Opera, but in IE (any version), every time you move an option, the select inputs decrease in width, until they completely disappear. It

[jQuery] Re: Trouble with jQuery Expander

2008-03-23 Thread Jason Huck
Either change your selectors to use an ID: $('#expandable p')... OR, change your div to use a class: div class=expandable... So, right now you have this: $('div.expandable p')... ... div id=expandable... But you need either this: $('div.expandable p')... ... div class=expandable... ...or

[jQuery] Re: Element with two classes

2008-03-09 Thread Jason Huck
This _should_ work (untested): $('table.cl1.cl2').addClass('abc'); - jason On Mar 9, 11:29 am, Johannes Theile [EMAIL PROTECTED] wrote: Hi, I have a page where I cannot change the XHTML code. This page contains two tables. The classes of the tables are as following: Table 1: table

[jQuery] Re: Element with two classes

2008-03-09 Thread Jason Huck
I do the same for Table 2: $('table.cl1').addClass('xyz'); xyz is also added to Table 1. So I'm looking for something to make a distinction between class=cl1 cl2 and class=cl1 to handle it differently. Maybe someone has an idea. Johannes On 9 Mrz., 17:01, Jason Huck [EMAIL PROTECTED

[jQuery] Re: creating an form element on the fly.

2008-03-09 Thread Jason Huck
Have you tried .append()? This test page works for me in Firefox 3.0b3/ Mac. I haven't tested it in anything else: html head script type=text/javascript src=http://cachefile.net/scripts/jquery/1.2.3/ jquery-1.2.3.min.js

[jQuery] Re: ul li ... hide an slide --- Beginner!

2008-03-09 Thread Jason Huck
I would suggest that you show/hide the unordered lists, rather than the anchors within them. This is most likely why what you're trying didn't work: you've hidden the a elements, but you've targeted the ul elements for the .slideDown(). Also, if you use .slideToggle(), you get .slideup and

[jQuery] Re: Identifying a specific UI element

2008-03-08 Thread Jason Huck
Funny you should ask. I had the same need recently, and couldn't find exactly what I was looking for, so I rolled my own. I discuss the basic left/right combo-select-box part here: http://devblog.jasonhuck.com/2008/03/08/combo-select-boxes-in-jquery/ As for the auto-complete part, I used the

[jQuery] Re: Dynamically generated HTML and effects on CSS

2008-03-08 Thread Jason Huck
Have you tried using !important? direction: rtl !important; ...always worth a shot, especially when not all of the CSS is under your direct control... - jason On Mar 8, 6:07 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Yes, i meant dir for html tags, direction for css respectively.