[ ... 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
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
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...
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
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
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 =
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:
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
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
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
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
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.
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:
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
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
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
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
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
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;
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
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
@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
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
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
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):
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
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
try this
jQuery(document).ready(function() {
$(.some-class).hover(
function () {
$(this).children('.inside').css
(display, block);
},
function
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/')
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
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
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.
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.
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
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
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
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
$(.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
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
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
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);
@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
@ 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
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)
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
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).
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
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:
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
@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
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 =
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...
This should work for you:
$('dt').click(function() {
$(this).nextAll('dd').doSomething()
});
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
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
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
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;
}
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
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
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.
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
61 matches
Mail list logo