[ ... 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
On Tue, Dec 22, 2009 at 10:40 AM, Charlie Griefer wrote:
> On Tue, Dec 22, 2009 at 10:34 AM, Mike Walsh wrote:
>
>>
>> [ ... snipped ... ]
>>
>> Thanks for pointing me in the right direction. This is what I ended
>> up getting to work:
>>
>>jQuery("span.event", ".calendar-table").eac
On Tue, Dec 22, 2009 at 10:34 AM, Mike Walsh wrote:
>
> [ ... 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 = this.innerHTML.replace(/()\
On Dec 22, 12:09 pm, Charlie Griefer
wrote:
> 2009/12/22 Š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...
>
> He did state that he's using generated HTML.
2009/12/22 Š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...
>
He did state that he's using generated HTML. He has no control over it.
Mike - this isn't really a jQ
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...
On Dec 22, 8:03 am, Dhruva Sagar 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 WordPress Calend
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 wrote:
> > Is there anyway to write a custom filter which returns the parent
> > nodes of the s
> 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
Got it working, see here,
http://code.google.com/p/aost/wiki/CustomJQuerySelectorInTellurium#:styles
On Aug 27, 5:57 pm, John wrote:
> Seems I should use css(), not attr().
>
> On Aug 27, 3:46 pm, John wrote:
>
> > Seems always begin with "ext-gen".
>
> > I wonder if I could split the style co
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; heigh
Seems I should use css(), not attr().
On Aug 27, 3:46 pm, John 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.
>
> Then the question
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 wrote:
> Also, it is not possible for us to use Ids because the ids are
> dynamically
> generated by the ExtJS fr
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 fou
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 wrote:
> 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
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 anot
Thanks.
Here is the html source,
The style in the jQuery selector should match the one defined in the
html source. I wonder if I
did any other thing wrong here.
Thanks,
John
On Aug 26, 6:45 am, Paolo Chiodi wrote:
> Maybe that t
Maybe that that the style attribute value should be exactly equal to
the one contained in html. I think style="A:B C:D" doesn't match
style="C:D A:B".
May also be that the browser has an internal rapresentation of the
style attribute slightly different from the one written in the html
(never tried
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 a
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 inlin
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; he
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
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
causin
@Karl: o, that was a serious c&p "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 c&p bug in there... ;)
@Mike: the pages I'm wor
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 element, an 'a.submit' or even just an 'a'
selector will be faster than '#content a.submit', because it's doin
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 7wit
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):
test('#
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 you
try this
jQuery(document).ready(function() {
$(".some-class").hover(
function () {
$(this).children('.inside').css
("display", "block");
},
func
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 $
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 wrote:
> That sucks. jQuery has no problem with $( 'a' ).attr( 'ajax:id' );
> Therefore it would be nice to use it in the selector too.
>
> t
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" wrote:
> Slightly :)
>
> You can not have special character in your html ATTRIBUTES.
>
> You should ren
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 wrote:
>
> Your right. The docs
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 wr
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 wro
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
$("div[
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 Valid
> $(".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 ha
Because you forgot to close the de first ul element.
Mauricio
-Mensagem Original-
De: <[EMAIL PROTECTED]>
Para: "jQuery (English)"
Enviada em: terça-feira, 28 de outubro de 2008 10:07
Assunto: [jQuery] JQuery selector
Hi everyone,
I have a question on JQuery selector. I want to a
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 comment next to
> it under different ul but have the same class "u"
@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 ne
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);
$('#element').not('input,textarea').text(new);
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 follow
@ 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 (JS
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 supers
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).
C
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 pm
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 ste
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 = func
@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
I doubt that will work, since all of the elements are siblings of
the clicked .
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 do thi
Please post a test case which fails in JSBin.com, and we'll be better
able to help you out!
-E
On Oct 13, 12:32 pm, Shadi Almosri <[EMAIL PROTECTED]> wrote:
> Hiya,
>
> I've not been able to find an answer to this online! can someone point
> out the correct syntax for this:
>
> var myRel = $(thi
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)"
Sent: Monday, October 13, 2008 9:32 AM
Subject: [jQuery] JQuery Selector an
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 t
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 sectio
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. Eve
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;
}
$(this).css('mar
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
>
>
>
>
> start
>
>
> start
>
>
>
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.
>
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 usi
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
Aaron Heimlich wrote:
Attribute selectors always begin with @[1] and I added quotes around
"images/m" just for safety, as jQuery sometimes has issues when you
don't use them.
I always forget the damn "@"! I don't think the quotes are necessary,
but they can't hurt, although allowing them hu
On 5/3/07, Scott Sauyet <[EMAIL PROTECTED]> wrote:
I'm not sure, but I think this would do it:
$("img[src*=images/m]").eq(0).addClass("newimage");
Very close, Scott. It should be:
$("[EMAIL PROTECTED]'images/m']").eq(0).addClass("newimage");
Attribute selectors always begin with @[1]
millionmonkey wrote:
This works - but I was wondering if there is a cleaner more jquery way
to do the same thing? Perhpas there is a selector that I missed in
the docs?
s = $("img").eq(0).attr("src")
if (s.search("images/m")>0) {
$("img").eq(0).addClass("newimage")
}
I'm not sure, but I t
66 matches
Mail list logo