[jQuery] Re: Managing scripts in AJAX applications

2009-04-11 Thread Jason Huck
On Apr 1, 1:39 pm, JMan 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 > order to functi

[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 class

[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

[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 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, IIRC,

[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: 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: > > > Blah > > Blah > > Blah > > > > that I am selecting like > > $("tr[class=.tableRow]").each( function(i

[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 <[EMA

[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

[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 takin

[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:

[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
of either dynamically adding the plugin, then using it, or > detecting if jquery 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 a

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

2008-05-18 Thread Jason Huck
That makes sense. jQuery is loaded, then extended by loading a plugin, but then replaced with a fresh, unaltered copy of jQuery, all of which takes place before document.ready(), where the (by then nonexistent) plugin is finally called. I would consider including the base jQuery file via a stub o

[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 ins

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

2008-05-16 Thread Jason Huck
without any element 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 slig

[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

[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: Stuff Other Stuff They are inside this form: Depending on which of these radio buttons is checked, certain other fields are required. So, in addition to the ma

[jQuery] Re: trigger event on resize of window

2008-05-15 Thread Jason Huck
Yes, .resize(): http://cachefile.net/scripts/jquery/1.2.3/ jquery-1.2.3.min.js"> $(function(){ $(window).resize(function(){ alert('You resized the window!');

[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 enterin

[jQuery] Re: How do I check a parent element?

2008-05-14 Thread Jason Huck
Use .is(): $('element').is('h1'); - jason On May 14, 4:27 pm, 703designs <[EMAIL PROTECTED]> wrote: > I want to check if a parent element is . How do I do that? The > best I know of now is to add a class to these and test hasClass() for > it.

[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: $(function(){ $('#yourbutton').click(function(){ $('#submit_result').load('test.php', { inp

[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

[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('') .parent() .find('input.focusClear') .focus(function(){ $(this).val(''); }); - jason On May 1, 8:07 pm, jquertil <[EMAIL PROTECTED]> wrote: > Hello.

[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 this

[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 would

[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: How to make auto-expand when there's more text ?

2008-04-15 Thread Jason Huck
You could do something like this (needs a bit of tweaking): http://cachefile.net/scripts/jquery/1.2.3/ jquery-1.2.3.min.js"> $(function(){ $('#sample').keyup(function(){

[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 hav

[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 re-bin

[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: > > $('#elHom

[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: div { display: none; } #no-1 { display: block; } http://cachefile.net/scripts/jquery/1.2.3/ jquery-1.2.3.min.js">

[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 looks

[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 <[EMA

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

2008-03-24 Thread Jason Huck
If your first 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 sele

[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: 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 al

[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: ... So, right now you have this: $('div.expandable p')... ... ... But you need either this: $('div.expandable p')... ... ... ...or this: $('#expandable p')... ... ... - jason On Mar

[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 elements, but you've targeted the elements for the .slideDown(). Also, if you use .slideToggle(), you get .slideup and .slideDown

[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: http://cachefile.net/scripts/jquery/1.2.3/ jquery-1.2.3.min.js"> var inputcount = 0;

[jQuery] Re: Element with two classes

2008-03-09 Thread Jason Huck
ake 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]> wrote: > > > This _should_ work (untested): > > > $(

[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:

[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.

[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 Pen