Any Ideas
IE probably totally fails to recognize the class set on an option
tag, you *may* try
$(#parentMenu option[parentMenu]).click();
regardless if that would or wouldn't work, what are you trying to
accomplish? simply setting the value of the select object and
firing off whatever
option tags are closed, i just didn't write them in here...
@MorningZ:
What I'm trying to do is update a second select box with options that
are specific to options in the first box. Basically, a linked menus
program. What was happening was all browser except IE were handling
the event
What I'm trying to do is update a second select box with options that
are specific to options in the first box
So why not use $(#parentMenu).val() ?? that will give you the
value of the selected option (or $(#parentMenu
option:selected).text() if you need the text) to drive the second
select
I don't know if this is overly simplified for your situation, but this
is what i mean
http://jsbin.com/oreqa/edit
the second select is driven/filled by the .val() of the first
On Dec 10, 7:23 pm, MorningZ morni...@gmail.com wrote:
What I'm trying to do is update a second select box with
On Dec 11, 7:12 am, Josh Nathanson joshnathan...@gmail.com wrote:
Maybe try closing the option tag?
The closing tag is optional, there are numerous elements that don't
need closing tags in HTML.
--
Rob
Yes thats true.
I just tested the exact code I have on jsbin and it worked fine.
http://jsbin.com/uhane source: http://jsbin.com/uhane/edit
I wonder if there is a difference in the included JQuery library on
jsbin and what jQuery currently has on their web site.
I will try to replace my local
FYI: It was the validate/validation plugin that was breaking my
example. When i commented out the include everything worked as
expected.
I needed to upgraded to the newer version of the validation plugin and
everything is back to normal!
Too many version dependencies, bah! It's too bad there
The reference does not show the use of quotes like you have:
http://docs.jquery.com/Selectors/not#selector
Their example: $(input:not(:checked) + span).css(background-
color, yellow);
Yours re-written: $('tr .myToggle:not(:hidden):odd').addClass
('gray');//hopefully works
On Nov 2, 3:31
When you write $('dl.set:first') you are saying, make a list of all DL
elements in the document that have the 'set' class, and give me the first
element in that list.
Putting this code inside the .each() loop doesn't change that. The
$('dl.set:first') selector stands on its own.
The code you
Hi Dave,
There are a few ways to do this. Probably the easiest is with :first-
child.
$('.set_list dl.set:first-child').addClass('first');
That will add the class to all dl class=set elements if they are a
child of .set_list and if they are the first child of their parent.
--Karl
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Selectors .each
When you write $('dl.set:first') you are saying, make a list of all DL
elements in the document that have the 'set' class, and give me the first
element in that list.
Putting this code inside the .each() loop doesn't change
Have a look at live()
http://docs.jquery.com/Events/live
Binds a handler to an event (like click) for all current - and future -
matched element.
Basically, when you add elements to the DOM dynamically after page load,
jQuery won't recognize those elements unless the live() method is used.
On
Looks like this will work. Thanks for your help.
On Sep 15, 4:29 pm, Charlie Griefer charlie.grie...@gmail.com wrote:
Have a look at live()
http://docs.jquery.com/Events/live
Binds a handler to an event (like click) for all current - and future -
matched element.
Basically, when you add
Looks like this will work. Thanks for your help.
On Sep 15, 4:29 pm, Charlie Griefer charlie.grie...@gmail.com wrote:
Have a look at live()
http://docs.jquery.com/Events/live
Binds a handler to an event (like click) for all current - and future -
matched element.
Basically, when you add
I have not found another way to retrieve information from an iframe.
BTW, I see no problem using that sintax
- Original Message -
From: smokinguns sameer.spad...@gmail.com
To: jQuery (English) jquery-en@googlegroups.com
Sent: Thursday, July 02, 2009 3:07 PM
Subject: [jQuery]
I had something kind of similar... are you sure your web server is sending
that content as Text/XML?
http://www.perturb.org/display/entry/924/
On Thu, Jun 18, 2009 at 5:09 AM, tom.nov...@googlemail.com
tom.nov...@googlemail.com wrote:
Hi,
I have the following XML structure:
getusername
input typ=checkbox class=myCheck name=myCheck value=1
input typ=checkbox class=myCheck name=myCheck value=2
input typ=checkbox class=myCheck name=myCheck value=3
input typ=checkbox class=myCheck name=myCheck value=4
$(.myCheck).each(function()
{
$(this)attr('checked', true);
});
I know
There isn't in HTML Specs a true value for checked attribute.
Try:
$(input:checkbox).attr(checked, checked);
Maurício
-Mensagem Original-
De: matt
Para: jQuery (English)
Enviada em: quinta-feira, 4 de junho de 2009 18:12
Assunto: [jQuery] Selectors only matching first element
Thanks. Unfortunately this doesn't seem to work either. The div
example from the page should work as it was copied directly, but it
doesn't. This is bizarre.
If it helps, I have the tablesorter, validate and maybe even UI
plugins set up here as well.. could one of them be interfering?
On Jun
This works here!
Have a look at: http://jsbin.com/awapu/edit
Maurício
-Mensagem Original-
De: matt
Para: jQuery (English)
Enviada em: quinta-feira, 4 de junho de 2009 19:35
Assunto: [jQuery] Re: Selectors only matching first element
Thanks. Unfortunately this doesn't
I think something in your HTML may be not formatted correctly.
Usually plug-ins would not interfere with simple selectors like $
(div). What happens if you remove the plugin code and try it?
On Jun 4, 12:35 pm, matt mattseb...@gmail.com wrote:
Thanks. Unfortunately this doesn't seem to work
Some HTML that replects your div's layout would be a huge help for
others to help you
On Dec 12, 4:01 am, mangaru dafne...@gmail.com wrote:
Hi all,
I was using jQuery as usual, but i found someting unusual...
Is there any bug with selector :last?
For me the selector #div_id div:last
div id=div_pdfs
div
input name=my_file_0 size=52 onchange=my$.addfilef( this );
type=file
input class=apagar botao value=Apagar onclick=my$.apagarf(
this ); type=button
/div
div
div
input name=my_file_1 size=52 onchange=my$.addfilef( this
);
Thats a lot of divs. You didn't say which div you're aiming to to get
at. But, I think :last doesn't work the wy you're expecting (which was
my initial expectation, as well). If you add some IDs you can see how
it's working:
div id=div_pdfs
div
input name=my_file_0 size=52
hi brian,
thanks for your help!
well... i only suspected that $( '#div_pdfs div:last div:last' ) worked
because $( '#div_pdfs div:eq(1) div:eq(1)' ) worked perfectly...
that HTML is generated by javascript, it has as much levels as needed... i
only do this like that because some browsers will
On Fri, Dec 12, 2008 at 2:41 PM, Diogo Neves dafne...@gmail.com wrote:
hi brian,
thanks for your help!
well... i only suspected that $( '#div_pdfs div:last div:last' ) worked
because $( '#div_pdfs div:eq(1) div:eq(1)' ) worked perfectly...
that HTML is generated by javascript, it has as
ok... now that i'm not working anymore, and i'm thinking slower, i believe
it make some sense because css3 should work in same way...
and now that i know how this work, then i want always the last level and it
make my code yet simpler :P
$( '#div_pdfs div:last' ) will always get the empty node
I owe you an apology, Hector - I'd been looking at the same lines for
so long, I'd stopped seeing what I'd written ... and was doubling-up
my selector. This DOES work:
$( '#themenu' ).children( 'li[id]' ).hover( function() {
var theID = $(this).attr('id');
Having - finally! - finished this, I thought I'd post my code. I'm
very sure it could be more compact, but I'm a bit of a Javascript dork
and thought others might benefit from my step-by-step approach ;)
// menu show/hide
$( '#themenu' ).children( 'li[id]' ).hover( function() {
You don't want :has you want a normal attribute selector.
$( '#themenu' ).children( 'li[id]' )
Karl Rudd
On Fri, Nov 7, 2008 at 11:14 AM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
I have read the other threads on this topic, but am still getting
nowhere ...
I'm trying to make a simple
Maybe this:
$( '#cat [ + theID + ] ul' ).toggle() ;
Should be like this?
$( #cat # + theID + ul ).toggle() ;
-Hector
On Thu, Nov 6, 2008 at 4:14 PM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
I have read the other threads on this topic, but am still getting
nowhere ...
I'm trying to
Karl, thank you SO much for that!
At least I can now be sure my toggle thing isn't failing because of
the g error
:)) Cherry.
On Nov 7, 12:26 am, Karl Rudd [EMAIL PROTECTED] wrote:
You don't want :has you want a normal attribute selector.
$( '#themenu' ).children( 'li[id]' )
Karl
Thank you, Hector, but there's still nothing happening .
Any other clues? (My grandmother and firstborn are now on offer)
Cherry
On Nov 7, 12:27 am, Hector Virgen [EMAIL PROTECTED] wrote:
Maybe this:
$( '#cat [ + theID + ] ul' ).toggle() ;
Should be like this?
$( #cat # + theID +
I assume that you can do the cross-domain Ajax call because this runs in the
browser chrome, is that right? If the Ajax call fails, then of course you
won't get very far.
Past that, I would take the code that is failing and break it down to see
what data you have at each step:
I believe I found the problem, but haven't tested the update yet.
According to the Learning jQuery book, I can't traverse AJAX'd HTML
content until I insert it into the current DOM. I'll be testing
inserting it into a hidden DIV and then going to town. Hopefully it
works. . .
On Sep 8, 8:18
Sure thing.
Here is the whole ubiquity (http://labs.mozilla.com/2008/08/
introducing-ubiquity/) command in its current form. The relevant
section is at the end.
CmdUtils.CreateCommand({
name: tag-cloud,
takes: {body_of_text: noun_arb_text},
description: Replaces selected text with a
Can you post a link to a test page that illustrates what you're trying to do
and what isn't working? It's pretty hard to tell what might be wrong without
seeing things like the HTML that the $.post() returns.
-Mike
From: [EMAIL PROTECTED]
I'm having trouble using a subsequent selector on an
that worked! thanks again!
On Sep 5, 10:53 am, Michael Geary [EMAIL PROTECTED] wrote:
if I need the Dom node and jQuery object on the same function
should I give each different variables or is there a workaround ?
Given a jQuery object, you can always get directly to its DOM node(s) with
if I need the Dom node and jQuery object on the same function
should I give each different variables or is there a workaround ?
Given a jQuery object, you can always get directly to its DOM node(s) with
[0], [1], etc. So you don't *need* another variable, but you can always use
one if you
Thank you Mike.
if I need the Dom node and jQuery object on the same function should I
give each different variables or is there a workaround ?
On Sep 3, 6:35 am, Michael Geary [EMAIL PROTECTED] wrote:
Imagine that you have an array:
var a = [ 'a', 'b', 'c' ];
Now you can call array methods
Imagine that you have an array:
var a = [ 'a', 'b', 'c' ];
Now you can call array methods on the array:
var t = a.join(); // 'a,b,c'
But what happens if you call an array method on one of the *elements* of the
array?
var x = a[0].join();
That's an error, because a[0] is a
Imagine that you have an array:
var a = [ 'a', 'b', 'c' ];
Now you can call array methods on the array:
var t = a.join(); // 'a,b,c'
But what happens if you call an array method on one of the *elements* of the
array?
var x = a[0].join();
That's an error, because a[0] is a *string*,
On Thu, Aug 28, 2008 at 2:58 AM, velij [EMAIL PROTECTED] wrote:
Hi everyone, this is my first message to the jquery group, hope you
don't mind and i'll improve over time :)
Welcome! We're here to help, and we hope to improve ourselves as well, with
your help :)
My HTML is this:
ul
Have you tried placing your effects code inside .ajaxStop()? Code
inside it does not fire until the AJAX request is complete.
http://docs.jquery.com/Ajax/ajaxStop#callback
Well, not everything uses AJAX... and there is a ton of code that
would be really messy to mix inside some of the ajax calls... Some of
it is using innerHTML also, which doesn't work for selectors either...
On Aug 21, 8:15 am, GasGiant [EMAIL PROTECTED] wrote:
Have you tried placing your
Maybe put the ton of code in a function so you'll only need the
function call inside of your callbacks?
On Aug 21, 11:35 am, DMS [EMAIL PROTECTED] wrote:
Well, not everything uses AJAX... and there is a ton of code that
would be really messy to mix inside some of the ajax calls... Some of
it
I, also, am not entirely sure what the end requirement is, but this
might help ...
$(document).ready(function() {
var inputUpdate = $('input.listcomplete').next('ul').find('li')
.bind('click', function(){
//this only works when a space is a valid separator, ie no LI
//text contains
nos wrote:
input name=Categories class=listcomplete value=Cat1 Cat2 Cat3
ul
liCat1/li
liCat2/li
liCat3/li
liCat4/li
liCat5/li
/ul
I'm not quite sure what you're looking to do, and this markup is part of
the issue. There is no type attribute on your input tag. Is this
just
I like that. I think it is clearer, especially for new users. Now who
can change the documentation?
Thanks,
Soetji
On Apr 7, 10:49 am, Karl Swedberg [EMAIL PROTECTED] wrote:
Hi,
I definitely see how the documentation can be confusing there. I think
the distinction was made because the ones
Thanks for all the responses.
So the API doc (http://docs.jquery.com/Selectors) should say all
selectors return Array Element instead of some of them return
Element. Am I correct?
Hi,
I definitely see how the documentation can be confusing there. I think
the distinction was made because the ones that just have Element are
the ones that only ever return a single element (in the array). I
wonder if it would make sense to still have a distinction somehow.
Maybe:
The Selector will always return an array of zero, one, or more
elements.
I'm not sure why the distinction has been made between Element and
Array of Elements - the only reason I could come up with was that
someone wanted to indicate that certain Selectors will/should return
only one element,
A selector will always return a jQuery object. Which is an array of
elements that matched the selector - with some additional functionality.
So, $(#myElement) returns a jQuery object. Which allows us to do
things like $(#myElement).hide();
But sometimes you need the original DOM element
Jean-Sébastien wrote:
hi, i try to select every element that is not children of another div.
i tried different ways but didn't find a solution.
regards
Try:
$('body *').filter(function() {
return this.parentNode.nodeName.toLowerCase() != 'div';
});
Don't think that will perform very
That would probably work but I wouldn't want to try it because I can't
imagine any non-trivial page where it would complete this century. :)
Then again I can't imagine why on Earth the OP would actually want to
be doing this in the first place. Perhaps if you (the OP) can give us
a description
'*:not(div) *'
or
'*:not(div) *' if they must be direct descendants
This is theoretically what you need, but won't work, it will also
select the head, the body.. almost everything but the children of the
divs. As gordon said, you should explain the situation.
Ariel Flesler
On 25 feb,
Thanks Josh,
I'll give that one a go. I also found I could do it using 'find', but
your solution looks a little bit tighter.
Phil
On Jan 19, 1:09 am, Josh Nathanson [EMAIL PROTECTED] wrote:
Try $(li, this) - it says look in the context of this for all li
elements.
-- Josh
- Original
Try $(li, this) - it says look in the context of this for all li
elements.
-- Josh
- Original Message -
From: Philboi [EMAIL PROTECTED]
To: jQuery (English) jquery-en@googlegroups.com
Sent: Thursday, January 17, 2008 9:37 PM
Subject: [jQuery] Selectors with this keyword
Hi
$('tr:has(img)').addClass('odd');
On Nov 22, 1:53 pm, Toccamonium [EMAIL PROTECTED] wrote:
Hi,
I'm using this code to add alternating table rows:
$('.content_table tr:odd').addClass('odd');
$('.content_table tr:even').addClass('even');
Now I have some cells with images includes:
tr
It's at: http://docs.jquery.com/Traversing/contents
Did iFrameTable.document... work? I thought it was
iFrameTable.ownerDocument maybe both work..
Anyway... that one was the jQuery-way to do that... I'm glad it
helped.
Ariel Flesler
On Nov 18, 8:21 pm, chrismarx [EMAIL PROTECTED] wrote:
$('#iframeTable').contents().find('td');
Ariel Flesler
On Nov 15, 8:25 am, chrismarx [EMAIL PROTECTED] wrote:
What would be a jQuery equivalent for this
iFrameTable.document.getElementsByTagName(td)
if iFrameTable is the id of the iframe?
this
iFrameTable.document.getElementsByTagName(td)
actually worked in ie and firefox (havent tried safari)
this:
$('#iFrameTable').contents().find('td');
worked beautifully as well. where is content() documented??
On Nov 17, 1:54 pm, Flesler [EMAIL PROTECTED] wrote:
Dealing with frames can be a bit tricky. The syntax you describe below is
an IE-only solution. There are some different ways to access the document
within the frame.
All browsers support window.frames[] as an indexer. If there is only one
frame on the page, window.frames[0] will work.
You
Perhaps this:
$('img',e).attr({src: path/to/image});
Where img is the tag for your image and the comma ',' after the 'img'
indicates that this selector is relative to 'e' (i.e. inside it).
BTW there is no such beast as a href tag - href is an attribute of
an a tag.
In the same way 'src' is an
Am 05.11.2007 um 14:02 schrieb boermans:
Perhaps this:
$('img',e).attr({src: path/to/image});
Brilliant.
And of course you are right - href is likewise src an attribute, not
a tag ;) typo...
thx a lot
Olaf
Can you post your ajax call? Ultimately, the code you provided should be
put in the call back to the ajax call.
On 8/22/07, electroteque [EMAIL PROTECTED] wrote:
Hi there, im having issues binding a click to links displayed after an
ajax call into a layer.
Here is what I have so far
On Aug 22, 2007, at 5:41 AM, electroteque wrote:
Hi there, im having issues binding a click to links displayed after an
ajax call into a layer.
Here is what I have so far
$(#content a.view).click(function(event) {
alert(this.href);
return false;
Apologies, looks like i got it working now
$('a.view').livequery('click',function(event) {
$(#content).load(/index/view/episode/ + this.href);
return false;
});
Good stuff !
\Karl Swedberg wrote:
On Aug 22, 2007, at 5:41 AM, electroteque wrote:
Hi there, im having
Hi here is the updated code
$(document).ready(function(){
$(a.nav).click(function(event) {
$(#content).load(this.href);
event.preventDefault();
});
$('a.view').livequery('click',function(event) {
alert('clicked');
return false;
Hmm looks like this.href is the full url.
Is there a defined way to strip the host etc so it just leaves the path.
Ideally id just want to put a number in and handel the rest in the
function, ie for paging numbers in a datagrid list.
Dan Rossi wrote:
Hi here is the updated code
On 6/20/07, Jörn Zaefferer [EMAIL PROTECTED] wrote:
Jonathan Sharp wrote:
On 6/20/07, *Jörn Zaefferer* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
wrote:
Jonathan Sharp wrote:
I have the following:
$('div class=foo').find('.foo').doSomething();
Why not simply
Doh! Thank you...
No problem :-)
--
Jörn Zaefferer
http://bassistance.de
Hi Karl
That's excellent, works a treat, thanks!
I tried :eq(0) and :nth(0) Selects the Nth element from the matched
element set
from
http://docs.jquery.com/Selectors#Custom_Selectors_2
without luck.
I thought it was possible though and of course the simple nth-child
does the trick. I was
Ah, one problem Karl. Thanks again for your help though there's just
one thing that I don't really understand.
I was attempting to use such a selector in a site-wide $
(document).ready() context. Hence this applies to all tables which is
problematic.
Hence initially I was attempting the
Hi Karl
I can't explain why but the code appears to be working as it should
now.
Rather strange but all is well that ends well.
Thanks again for your excellent, considered and patient help.
pd
On May 8, 1:37 pm, Karl Swedberg [EMAIL PROTECTED] wrote:
Hmmm. I'm not sure what could be causing
Hey PD,
Not a problem at all. It was a fun diversion. :-) Glad you got it
working!
--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com
On May 8, 2007, at 12:34 AM, pd wrote:
Hi Karl
I can't explain why but the code appears to be working as it should
76 matches
Mail list logo