[jQuery] Re: jQuery Selector Help

2009-12-23 Thread Mike Walsh
[ ... snipped ... ] ... and after looking at your code (which always helps), I see you're referencing this (as opposed to jQuery's $(this)), which is why html() wouldn't have worked. In that case, sure.  It's been said that this is more efficient than creating a jQuery reference to it via

[jQuery] Re: jQuery Selector Help

2009-12-22 Thread Mike Walsh
On Dec 22, 8:03 am, Dhruva Sagar dhruva.sa...@gmail.com wrote: I would suggest you to wrap the sections within * into a div and select that div. Thanks Regards, Dhruva Sagar. [ ... snipped ... ] Unfortunately I don't have control of the generated content. The content is generated by a

[jQuery] Re: jQuery Selector Help

2009-12-22 Thread Šime Vidas
Well, you selected BR elements, which are empty elements, so it's no mystery why this.innerHTML returns undefined... Also, DIVs shouldn't appear inside SPANs...

Re: [jQuery] Re: jQuery Selector Help

2009-12-22 Thread Charlie Griefer
2009/12/22 Šime Vidas sime.vi...@gmail.com Well, you selected BR elements, which are empty elements, so it's no mystery why this.innerHTML returns undefined... Also, DIVs shouldn't appear inside SPANs... He did state that he's using generated HTML. He has no control over it. Mike - this

[jQuery] Re: jQuery Selector Help

2009-12-22 Thread Mike Walsh
On Dec 22, 12:09 pm, Charlie Griefer charlie.grie...@gmail.com wrote: 2009/12/22 Šime Vidas sime.vi...@gmail.com Well, you selected BR elements, which are empty elements, so it's no mystery why this.innerHTML returns undefined... Also, DIVs shouldn't appear inside SPANs... He did

Re: [jQuery] Re: jQuery Selector Help

2009-12-22 Thread Charlie Griefer
On Tue, Dec 22, 2009 at 10:34 AM, Mike Walsh mike_wa...@mindspring.comwrote: [ ... snipped ... ] Thanks for pointing me in the right direction. This is what I ended up getting to work: jQuery(span.event, .calendar-table).each(function(){ var html =

Re: [jQuery] Re: jQuery Selector Help

2009-12-22 Thread Charlie Griefer
On Tue, Dec 22, 2009 at 10:40 AM, Charlie Griefer charlie.grie...@gmail.com wrote: On Tue, Dec 22, 2009 at 10:34 AM, Mike Walsh mike_wa...@mindspring.comwrote: [ ... snipped ... ] Thanks for pointing me in the right direction. This is what I ended up getting to work:

[jQuery] Re: jQuery selector return parent

2009-10-21 Thread Dave Methvin
Is there anyway to write a custom filter which returns the parent nodes of the selector? ie) div.someClass:parentNode or ancestor: div.someClass would return the parent element of div.someClass. Not that I know of, but you might be able to use the :has selector if you know enough about the

[jQuery] Re: jQuery selector return parent

2009-10-21 Thread vtjiles
Thanks Dave I think you may be on to something. I think $(*:has( div.someClass)) would work. Won't be fast, but that's not a concern. I'll give it a shot tomorrow. On Oct 21, 12:40 pm, Dave Methvin dave.meth...@gmail.com wrote: Is there anyway to write a custom filter which returns the parent

[jQuery] Re: jQuery selector for style attribute

2009-08-28 Thread John
Got it working, see here, http://code.google.com/p/aost/wiki/CustomJQuerySelectorInTellurium#:styles On Aug 27, 5:57 pm, John jian.fang.subscr...@gmail.com wrote: Seems I should use css(), not attr(). On Aug 27, 3:46 pm, John jian.fang.subscr...@gmail.com wrote: Seems always begin with

[jQuery] Re: jQuery selector for style attribute

2009-08-27 Thread James
Is that for the whole ID? (e.g. it maybe 'ext-gen439' once or 'blah- foo3456' another) Or only just the number at the end? (e.g. always begin with ext-gen) On Aug 26, 5:10 pm, John jian.fang.subscr...@gmail.com wrote: Also, it is not possible for us to use Ids because the ids are dynamically

[jQuery] Re: jQuery selector for style attribute

2009-08-27 Thread John
Seems I should use css(), not attr(). On Aug 27, 3:46 pm, John jian.fang.subscr...@gmail.com wrote: Seems always begin with ext-gen. I wonder if I could split the style content into multiple single attributes and then use attr() to compare. Based on that, I could create a custom selector.

[jQuery] Re: jQuery selector for style attribute

2009-08-27 Thread John
Seems always begin with ext-gen. I wonder if I could split the style content into multiple single attributes and then use attr() to compare. Based on that, I could create a custom selector. Then the question is, for example, I have a style attribute such as overflow: auto; width: 356px; height:

[jQuery] Re: jQuery selector for style attribute

2009-08-26 Thread John
Thanks. Here is the html source, div id=x-form-el-ext-comp-1043 class=x-form-element style=padding-left: 130px; div id=ext-gen438 class=x-form-field-wrap style=width: 360px; input id=programId type=hidden name=programId value=/ input id=ext-comp-1043

[jQuery] Re: jQuery selector for style attribute

2009-08-26 Thread James
As Paolo mentioned, despite how it looks in a browser's source, the internal representation within the DOM may be different depending on the browser. In one browser it could be: overflow: auto; width: 356px; height: 100px; in another it could be: overflow:auto; width:356px; height:100px; in

[jQuery] Re: jQuery selector for style attribute

2009-08-26 Thread John
Also, it is not possible for us to use Ids because the ids are dynamically generated by the ExtJS framework. On Aug 26, 4:34 pm, James james.gp@gmail.com wrote: As Paolo mentioned, despite how it looks in a browser's source, the internal representation within the DOM may be different

[jQuery] Re: jQuery selector for style attribute

2009-08-26 Thread John
I am working on the open source project: Tellurium automated testing framework, which is a web testing framework built on top of Selenium. We leverage jQuery to add jQuery selector as a locator to speed up the test performance in IE and also add other new functionalities. More details could be

[jQuery] Re: jQuery selector for style attribute

2009-08-25 Thread Mauricio (Maujor) Samy Silva
Sintax for the selector is: $('img[style=overflow: auto; width: 356px; height: 100px;]') Maurício -Mensagem Original- De: John Para: jQuery (English) Enviada em: terça-feira, 25 de agosto de 2009 14:36 Assunto: [jQuery] jQuery selector for style attribute Hi, I want

[jQuery] Re: jQuery selector for style attribute

2009-08-25 Thread John
Thanks Maurício for your quick response. I have a program to automatically generate jQuery selectors based on some UI element attributes and seems your syntax is not always working. For example, 1) working: $('div:has(input[type=text][readonly=true], img [style=overflow: auto; width: 356px;

[jQuery] Re: jQuery selector for style attribute

2009-08-25 Thread James
Couldn't you just set another class for where you have that long style attribute? That'll make it so much nicer and less error prone for what you're trying to achieve. I'm not telling you that you need to remove the inline style, but just added another class on the element where you have the

[jQuery] Re: jQuery selector for style attribute

2009-08-25 Thread John
That may not be an option, at least now. The reason is that the jQuery selector is automatically generated by a framework, which may be rather random and difficult to set another class. The first thing is to get it work. As long as the syntax is correct, it should work fine, right? I care more

[jQuery] Re: jQuery selector performance / jQuery Tester

2009-07-03 Thread olsch01
@Karl: o, that was a serious cp bug... :) I was aware that IE6 and 7 don't support getElementsByClassName (see my initial message), still the results of my first test showed similar results for the class selector. I hope I didn't have another cp bug in there... ;) @Mike: the pages I'm

[jQuery] Re: jQuery selector performance / jQuery Tester

2009-07-03 Thread olsch01
I re-ran the test now. test('#content a.submit'); test('a.submit'); test('.submit'); test('(#content).find(a.submit)'); Basically I get the same result: for my pages (!) element.MyClass has the best average performance. I guess it's as Karl mentioned earlier: If the selectors aren't causing a

[jQuery] Re: jQuery selector performance / jQuery Tester

2009-07-02 Thread Karl Swedberg
On Jul 2, 2009, at 8:45 AM, north wrote: Hi, I just tested all my jQuery selectors using the jQuery Tester (http:// jquery.nodnod.net), and the results seem to contradict one thing I read in a performance article: that you should descend from the closest parent ID when using classes in your

[jQuery] Re: jQuery selector performance / jQuery Tester

2009-07-02 Thread olsch01
Hi Karl, thanks for your reply. I used jQuery tester in FF2 + 3, IE6, 7 + 8, Opera 9.64 and I think also in Safari 4 (on my Win XP machine). The results were are all kinda similar. Using the class selector was always fastest. I just ran the following test (choosing jQuery 1.3.2 again):

[jQuery] Re: jQuery selector performance / jQuery Tester

2009-07-02 Thread Karl Swedberg
If you're doing this: test('#content a.submit'); then you shouldn't compare it to this: test('(#myDiv).find(span.myClass)'); that's apples to oranges. instead, compare it to this: test('(#content).find(a.submit)'); The reason the other browsers are so much faster than IE 6 and 7with bare

[jQuery] Re: jQuery selector performance / jQuery Tester

2009-07-02 Thread Michael Geary
You can't measure whether one selector will be faster than another on all possible pages. All you can measure is which is faster on the page you're testing. On a page with only a single a element, an 'a.submit' or even just an 'a' selector will be faster than '#content a.submit', because it's

[jQuery] Re: jquery selector

2009-06-25 Thread Lee R Lemon III
try this jQuery(document).ready(function() { $(.some-class).hover( function () { $(this).children('.inside').css (display, block); }, function

[jQuery] Re: JQuery Selector

2009-03-13 Thread ricardobeat
It's not a selector. Where did you come across that? The makes it think you want to create an element. It does nothing more than creating a textNode that contains the string %=x.y % (and a temporary DIV to hold it). This $(' ') does the same. The '#' is ignored just as if you used $ ('#div/')

[jQuery] Re: jQuery selector question - Having : in attribute name

2009-01-14 Thread jQuery Lover
You can not have special character in attribute names. (it's not valid markup) Documentation is saying that your should escape VALUE bit if it contains special characters. - Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Wed, Jan 14, 2009 at 2:11 PM, naden

[jQuery] Re: jQuery selector question - Having : in attribute name

2009-01-14 Thread naden
Your right. The docs said: Note: if you wish to use any of the meta-characters described above as a literal part of a name, you must escape the character with two backslashes (\). For example: #foo\\:bar #foo\\[bar\\] #foo\\.bar and so I did. I used \\: to escape the : or I'm gettin you

[jQuery] Re: jQuery selector question - Having : in attribute name

2009-01-14 Thread jQuery Lover
Slightly :) You can not have special character in your html ATTRIBUTES. You should rename ajax:id to something else. Ex: ajax_id or ajaxId. - Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Wed, Jan 14, 2009 at 5:16 PM, naden n...@naden.de wrote: Your right.

[jQuery] Re: jQuery selector question - Having : in attribute name

2009-01-14 Thread naden
That sucks. jQuery has no problem with $( 'a' ).attr( 'ajax:id' ); Therefore it would be nice to use it in the selector too. thanks anyway have to change it. On 14 Jan., 14:05, jQuery Lover ilovejqu...@gmail.com wrote: Slightly :) You can not have special character in your html ATTRIBUTES.

[jQuery] Re: jQuery selector question - Having : in attribute name

2009-01-14 Thread Balazs Endresz
Just investigated it: http://dev.jquery.com/ticket/3729 The colon is valid I think, but it's true, there are some restrictions. On Jan 14, 2:27 pm, naden n...@naden.de wrote: That sucks. jQuery has no problem with $( 'a' ).attr( 'ajax:id' ); Therefore it would be nice to use it in the

[jQuery] Re: jQuery selector fails when in FOR loop

2008-12-12 Thread MorningZ
Can you show what your for loop currently looks like? Answer for question #2: using the .each method, a paramenter is passed to the anonymous function that is the current 0-based index of the item in the collection without seeing your code, i will take a guess at helping you though

[jQuery] Re: JQuery selector

2008-10-28 Thread BB
Try: $(.u:last li:last).addClass(last); On 28 Okt., 13:07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi everyone, I have a question on JQuery selector. I want to add a class, last, into li elements where have !-- This is the one -- comment next to it under different ul but have the same

[jQuery] Re: JQuery selector

2008-10-28 Thread Mauricio (Maujor) Samy Silva
Because you forgot to close the de first ul element. Mauricio -Mensagem Original- De: [EMAIL PROTECTED] Para: jQuery (English) jquery-en@googlegroups.com Enviada em: terça-feira, 28 de outubro de 2008 10:07 Assunto: [jQuery] JQuery selector Hi everyone, I have a question on

[jQuery] Re: JQuery selector

2008-10-28 Thread John Resig
$(.u:last li:last).addClass(last); Close. $(ul.u li:last-child).addClass(last); You may want to move that child ul inside an li - it's not proper HTML to put a UL inside a UL. --John On 28 Okt., 13:07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi everyone, I have a question on

[jQuery] Re: JQuery selector

2008-10-28 Thread Mauricio (Maujor) Samy Silva
It's preferable correct the invalid markup and use the selector you have chose or ( $(.u li:last-child). E F selects all elements F that are descendants of E element. E F selects all elements F that are children (direct descendants) of E element. Mantra: Validate! Validate! and

[jQuery] Re: JQuery Selector and Java Script Variable

2008-10-20 Thread Remy Sharp
I just tried dropped in some vanilla XML and it saves and renders fine: http://jsbin.com/uwedo/edit I cleared out the JavaScript tab, and just entered plain old XML in the HTML tab - the saved output is just XML: http://jsbin.com/uwedo/ yeah! I couldn't manage to put xml in jsbin. I

[jQuery] Re: JQuery Selector and Java Script Variable

2008-10-20 Thread ricardobeat
You can use this syntax: if ( $('#elementToBeUpdated').is('input,textarea') ) { // use val(); } else { // use text(); } or you can take advantage of the empty return object (only one will execute): $('#element').filter('input,textarea').val(new);

[jQuery] Re: JQuery Selector and Java Script Variable

2008-10-20 Thread RotinPain
@ricardobeat: Great! thank you for your help. I see that there are plenty of manners that can be used to retrieve the type of an element, now it's to choose the good one ;) . I'll use the ternary one for my code but I will also keep in mind the other functions you gave here for using them in my

[jQuery] Re: JQuery Selector and Java Script Variable

2008-10-19 Thread RotinPain
@ Balazs Endresz: You're right, and Ricardobeat has given the good answer ;) Even if i'm working with Firebug I didn't notice this behavior between value and text. @Remy: yeah! I couldn't manage to put xml in jsbin. I followed the ajax video without no success. Any view where i pasted the xml

[jQuery] Re: JQuery Selector and Java Script Variable

2008-10-18 Thread RotinPain
I met a similar issue, but i can determine it happens only with Firefox (3.0.3). The variable selector seems to be the problem. I explained the whole thing here:http://jsbin.com/aciwi in short, $([id=' + variableId + ']).text( variableValue ); won't always work with FF (it works in first steps)

[jQuery] Re: JQuery Selector and Java Script Variable

2008-10-18 Thread Balazs Endresz
In your case the proplem is that you're using .text() instead of .value() on the textarea. The strangest thing is why does .text() even work unless you change the content? It's quite misleading because it shouldn't work on input elements: http://docs.jquery.com/Attributes/text On Oct 18, 6:09 

[jQuery] Re: JQuery Selector and Java Script Variable

2008-10-18 Thread Remy Sharp
Slightly aside to your actual problem - I looked at the jsbin dump you did and the source XML (http://jsbin.com/ebupo ) and noticed the XML tags had been escaped - so I've gone in to the database and updated it manually so your test page now works (or works in that it demonstrates the problem).

[jQuery] Re: JQuery Selector and Java Script Variable

2008-10-18 Thread ricardobeat
At first, the textarea has 'text content' (inside the tags), and it's shown inside. When you click the buttons, it updates this text content. *But*, when you edit it manually, you are updating the textarea's VALUE attribute, not the the text inside. When you have both, the value attribute

[jQuery] Re: JQuery Selector and Java Script Variable

2008-10-13 Thread Josh Nathanson
That looks like the proper syntax to get your desired selector. Are you getting an error or unexpected results? -- Josh - Original Message - From: Shadi Almosri [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Monday, October 13, 2008 9:32 AM Subject:

[jQuery] Re: jQuery selector that matches dd's elements

2008-10-13 Thread Karl Swedberg
I doubt that will work, since all of the dd elements are siblings of the clicked dt. Mauricio, Take a look at the nextUntil plugin. That should do what you're looking for: http://docs.jquery.com/JQuery_1.2_Roadmap#.nextUntil.28.29_.2F_.prevUntil.28.29 After including the plugin, you can

[jQuery] Re: jQuery selector that matches dd's elements [SOLVED]

2008-10-13 Thread Mauricio (Maujor) Samy Silva
@Paperboy: Sorry, both solutions you pointed out selects ALL dd after the dt clicked. Tks! @Karl: The plugin you pointed out do the job. Tks! Maurício

[jQuery] Re: jQuery selector that matches dd's elements [SOLVED]

2008-10-13 Thread ricardobeat
Already solved but I thought it would be fun to solve it by hand :D jQuery.fn.getDDs = function(){ var next = $(this[this.length-1]).next(); if(next.is('dd')){ return this.add(next).getDDs(); } else { return this.not('dt'); }; }; this is a bit faster: jQuery.fn.getDDs =

[jQuery] Re: jQuery selector that matches dd's elements

2008-10-12 Thread [EMAIL PROTECTED]
You could use something like this: $('dt:eq(0)').nextAll('dd').doSomething(); $('dt:eq(1)').nextAll('dd').doSomething(); $('dt:eq(2)').nextAll('dd').doSomething(); $('dt:eq(3)').nextAll('dd').doSomething(); $('dt:eq(4)').nextAll('dd').doSomething(); // and so on...

[jQuery] Re: jQuery selector that matches dd's elements

2008-10-10 Thread [EMAIL PROTECTED]
This should work for you: $('dt').click(function() { $(this).nextAll('dd').doSomething() });

[jQuery] Re: jQuery selector works with FF and not on IE

2008-08-29 Thread micah
you can do $(':input:visible') instead. i've found that :not can be picky at times. could be totally imagined on my part, but i usually use $.not() instead, despite the extra traversal of the nodeset involved. -micah On Aug 29, 10:19 am, anuradha k [EMAIL PROTECTED] wrote: Hi All I am

[jQuery] Re: JQuery Selector

2008-04-10 Thread Wizzud
Ah, sorry. I was looking at it wrt the literal elements, not as the representation of an external structure. Apologies. On Apr 10, 3:52 am, JB [EMAIL PROTECTED] wrote: A section is just and idea, here it is represented by 'sectionstart' divs and 'sectionend' divs, everything within a section

[jQuery] Re: JQuery Selector

2008-04-09 Thread Wizzud
Actually, no I can't see. Every DIV with #survey contains just one text node - nothing else. On Apr 9, 10:27 pm, JB [EMAIL PROTECTED] wrote: I've got the following html div id=survey br / div class=sectionstart start /div div class=sectionstart

[jQuery] Re: JQuery Selector

2008-04-09 Thread Hamish Campbell
This should be quite easy - for each section start you add some padding, for each section end you remove it: var sectionPadding = 0; var sectionIndent = 10; $('#survey div').each(function(){ if( $(this).is('.sectionend') ) { sectionPadding -= sectionIndent; }

[jQuery] Re: JQuery Selector

2008-04-09 Thread JB
A section is just and idea, here it is represented by 'sectionstart' divs and 'sectionend' divs, everything within a section should be indented progressively based on how deep it is (infinitely deep is possible). On Apr 9, 6:53 pm, Wizzud [EMAIL PROTECTED] wrote: Actually, no I can't see. Every

[jQuery] Re: Jquery Selector even and first child (nested tables striping)

2008-03-31 Thread Klaus Hartl
Use the child combinator to select just the children of a certain element. In your case, assuming you have an tbody element: $('table.basic tbody tr:even').addClass('even'); --Klaus On Mar 31, 8:45 pm, rsmolkin [EMAIL PROTECTED] wrote: Hi, I've ran into a little problem.  I'm using the

[jQuery] Re: Jquery Selector even and first child (nested tables striping)

2008-03-31 Thread rsmolkin
Ok, found a solution if anyone else is searching! $('table.basic tr:nth-child(even)').addClass('even'); -Roman On Mar 31, 2:45 pm, rsmolkin [EMAIL PROTECTED] wrote: Hi, I've ran into a little problem. I'm using the code below to do alternate row striping on a table.

[jQuery] Re: JQUERY SELECTOR based on image path

2007-05-03 Thread millionmonkey
Thanks Aaron and Scott - that works perfectly. And Aaron, thanks for the link - I had looked at that area but didn't connect the dots. This opens up a lot for me. thanks again George On May 3, 3:01 pm, millionmonkey [EMAIL PROTECTED] wrote: Hi folks, This works - but I was wondering if