[jQuery] Re: :contains selector not working in IE
This is apparently a bug in 1.3.2. I have reverted to 1.2.6 until its fixed. On Jul 15, 4:15 pm, n0ah jku...@gmail.com wrote: I have the following code working in FF but not IE: function processSearchResult(xData, status){ var resultHTML = ; if (status == success) { $(xData.responseXML).find(QueryResult).each(function() { var x = $(xml + $(this).text() + /xml); x.find(Document).each(function(){ var title = $(PropertiesPropertyName:contains('TITLE'), $ (this)).next().next().text(); var url = $(ActionLinkUrl, $(this)).text(); var title never gets set unless I take out the :contains. Any idea how to solve this issue? -j
[jQuery] Re: Checkbox selector not working
On Tue, Apr 7, 2009 at 8:48 AM, Chandra cank...@gmail.com wrote: Hi Guys I am new to jQuery... I am trying to get all the checkboxes checked in the form $(inp...@name^=ddcommercialtypes_check][type='checkbox'] [checked='true']).each(function() { checkedBoxes1 += , + $(this)[0].value; }); Here I am getting all the checkboxes checked in that form, instead of checkboxes with the names starting with ddCommercialTypes_Check. Please let me know what I am doing wrong in that selector statement... What version of jQuery are you running? The @ in front of the selector was deprecated in a previous version, and as of 1.3, will not work at all. Try removing that. Replace [...@name^=... with [name^=... -- I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.
[jQuery] Re: Checkbox selector not working
Thanks alot guys... that is the problem.. when I removed @, it works just fine. Thanks again Chandra On Apr 7, 2:17 pm, MorningZ morni...@gmail.com wrote: And to clean up the selector some $(:checkbox[name^=ddCommercialTypes_Check]:checked) On Apr 7, 11:48 am, Chandra cank...@gmail.com wrote: Hi Guys I am new to jQuery... I am trying to get all the checkboxes checked in the form $(inp...@name^=ddcommercialtypes_check][type='checkbox'] [checked='true']).each(function() { checkedBoxes1 += , + $(this)[0].value; }); Here I am getting all the checkboxes checked in that form, instead of checkboxes with the names starting with ddCommercialTypes_Check. Please let me know what I am doing wrong in that selector statement... Thanks Chandra- Hide quoted text - - Show quoted text -
[jQuery] Re: Checkbox selector not working
And to clean up the selector some $(:checkbox[name^=ddCommercialTypes_Check]:checked) On Apr 7, 11:48 am, Chandra cank...@gmail.com wrote: Hi Guys I am new to jQuery... I am trying to get all the checkboxes checked in the form $(inp...@name^=ddcommercialtypes_check][type='checkbox'] [checked='true']).each(function() { checkedBoxes1 += , + $(this)[0].value; }); Here I am getting all the checkboxes checked in that form, instead of checkboxes with the names starting with ddCommercialTypes_Check. Please let me know what I am doing wrong in that selector statement... Thanks Chandra
[jQuery] Re: Simple selector not working in 1.3.1 and webkit (safari and chrome)
Hi, I relative new to JQuery but I have some code that works fine in Firefox, IE and Opera, but seem to be having a problem with Chrome and Safari. Here is part of the code: $(form#quiz_form_1).submit(function(){ alert(This is testing); $.post(question_result.asp,{ quiz_answer: $(input [...@name='quiz_answer_1']:checked).val(), currdiv: $(input [...@name='currdiv_1']).val() }, function(xml) { question_response(xml); });//end of $.post return false; }); here is the function question_response function question_response(xml) { //next div to show var next = $(nextdiv,xml).text(); var current = next - 1; alert(This is test); //if the it was the correct answer if ( $(answer,xml).text() == 1) { //display next part of the story $(#story_+next).slideToggle(slow); //diplay next quiz $(#quiz_+next).slideToggle(slow); //display message to answer $(#answer_+current).html($(message,xml).text()); } else { //display message $(#answer_+current).html($(message,xml).text()); } } I place alert screens for debugging, the alert screen in the function question_response is never display in safari or Chrome I don't know if there is problem with the Ajax code. Thanks! On Feb 4, 5:05�am, Javier Martinez ecentin...@gmail.com wrote: Sure! Createdhttp://dev.jquery.com/ticket/4058 Hope there is some easy patch, if not, I will regret to 1.2.6 inmediately :( 2009/2/3 John Resig jere...@gmail.com That's odd. Could you file a bug on this? http://dev.jquery.com/newticket Thanks! --John On Tue, Feb 3, 2009 at 10:39 AM, Javier Martinez ecentin...@gmail.com wrote: I'm creating a component for an application I'm developing and I have upgraded jquery to the last version to get it's speed boost. After some testing I have seen that my component is not working correctly in webkit browsers because there is some bug with the new Sizzle selector of the new jquery. I can't provide my source files, but I have created a simple test case that shows this error. !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN � � http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en head � � meta http-equiv=Content-Type content=text/html; charset=utf-8 / � � script type=text/javascript src=jquery.js/script � � script type=text/javascript � � � � $(function() { � � � � � � var container = $('#container'); � � � � � � var containerSelecteds = function() { � � � � � � � � return container.find('ul.selected'); � � � � � � }; � � � � � � var bodySelecteds = function() { � � � � � � � � return $('ul.selected'); � � � � � � }; � � � � � � var select = function(nodes) { � � � � � � � � containerSelecteds().removeClass('selected'); � � � � � � � � nodes.addClass('selected'); � � � � � � � � // the container html show me that the element has the class selected � � � � � � � � alert(container.html()); � � � � � � � � // webkit (chrome and safari) says that there are no elements inside of container with the class selected � � � � � � � � alert(containerSelecteds().length); � � � � � � � � // but the element exists in the dom, and it has the classname selected !! � � � � � � � � alert(bodySelecteds().length); � � � � � � }; � � � � � � var element = $('ul class=someclassliMyText/li/ul').appendTo(container); � � � � � � select(element, false); � � � � }); � � /script /head body � � div id=container style=border:1px solid #ccc;height:300px;width:300px/div /body /html I will try to explain the error: I'm inserting a node inside the container div, and applying a classname selected to this node. After this, I want to select the nodes inside container that have this classname. Firefox, IE, etc, says that there is one node inside container. But webkit browsers says that there is a node with this classname in the dom, but not inside container. I think that this is a quite simple css selector, so I don't know why it fails. Thanks. PD: it doesn't fails with jquery 1.2.6- Hide quoted text - - Show quoted text -
[jQuery] Re: Simple selector not working in 1.3.1 and webkit (safari and chrome)
You should remove the @ from your selectors, they're invalid. --John On Thu, Apr 2, 2009 at 12:10 PM, ale alejandr...@gmail.com wrote: Hi, I relative new to JQuery but I have some code that works fine in Firefox, IE and Opera, but seem to be having a problem with Chrome and Safari. Here is part of the code: $(form#quiz_form_1).submit(function(){ alert(This is testing); $.post(question_result.asp,{ quiz_answer: $(input [...@name='quiz_answer_1']:checked).val(), currdiv: $(input [...@name='currdiv_1']).val() }, function(xml) { question_response(xml); });//end of $.post return false; }); here is the function question_response function question_response(xml) { //next div to show var next = $(nextdiv,xml).text(); var current = next - 1; alert(This is test); //if the it was the correct answer if ( $(answer,xml).text() == 1) { //display next part of the story $(#story_+next).slideToggle(slow); //diplay next quiz $(#quiz_+next).slideToggle(slow); //display message to answer $(#answer_+current).html($(message,xml).text()); } else { //display message $(#answer_+current).html($(message,xml).text()); } } I place alert screens for debugging, the alert screen in the function question_response is never display in safari or Chrome I don't know if there is problem with the Ajax code. Thanks! On Feb 4, 5:05 am, Javier Martinez ecentin...@gmail.com wrote: Sure! Createdhttp://dev.jquery.com/ticket/4058 Hope there is some easy patch, if not, I will regret to 1.2.6 inmediately :( 2009/2/3 John Resig jere...@gmail.com That's odd. Could you file a bug on this? http://dev.jquery.com/newticket Thanks! --John On Tue, Feb 3, 2009 at 10:39 AM, Javier Martinez ecentin...@gmail.com wrote: I'm creating a component for an application I'm developing and I have upgraded jquery to the last version to get it's speed boost. After some testing I have seen that my component is not working correctly in webkit browsers because there is some bug with the new Sizzle selector of the new jquery. I can't provide my source files, but I have created a simple test case that shows this error. !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en head meta http-equiv=Content-Type content=text/html; charset=utf-8 / script type=text/javascript src=jquery.js/script script type=text/javascript $(function() { var container = $('#container'); var containerSelecteds = function() { return container.find('ul.selected'); }; var bodySelecteds = function() { return $('ul.selected'); }; var select = function(nodes) { containerSelecteds().removeClass('selected'); nodes.addClass('selected'); // the container html show me that the element has the class selected alert(container.html()); // webkit (chrome and safari) says that there are no elements inside of container with the class selected alert(containerSelecteds().length); // but the element exists in the dom, and it has the classname selected !! alert(bodySelecteds().length); }; var element = $('ul class=someclassliMyText/li/ul').appendTo(container); select(element, false); }); /script /head body div id=container style=border:1px solid #ccc;height:300px;width:300px/div /body /html I will try to explain the error: I'm inserting a node inside the container div, and applying a classname selected to this node. After this, I want to select the nodes inside container that have this classname. Firefox, IE, etc, says that there is one node inside container. But webkit browsers says that there is a node with this classname in the dom, but not inside container. I think that this is a quite simple css selector, so I don't know why it fails. Thanks. PD: it doesn't fails with jquery 1.2.6- Hide quoted text - - Show quoted text -
[jQuery] Re: Simple selector not working in 1.3.1 and webkit (safari and chrome)
Sure! Created http://dev.jquery.com/ticket/4058 Hope there is some easy patch, if not, I will regret to 1.2.6 inmediately :( 2009/2/3 John Resig jere...@gmail.com That's odd. Could you file a bug on this? http://dev.jquery.com/newticket Thanks! --John On Tue, Feb 3, 2009 at 10:39 AM, Javier Martinez ecentin...@gmail.com wrote: I'm creating a component for an application I'm developing and I have upgraded jquery to the last version to get it's speed boost. After some testing I have seen that my component is not working correctly in webkit browsers because there is some bug with the new Sizzle selector of the new jquery. I can't provide my source files, but I have created a simple test case that shows this error. !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en head meta http-equiv=Content-Type content=text/html; charset=utf-8 / script type=text/javascript src=jquery.js/script script type=text/javascript $(function() { var container = $('#container'); var containerSelecteds = function() { return container.find('ul.selected'); }; var bodySelecteds = function() { return $('ul.selected'); }; var select = function(nodes) { containerSelecteds().removeClass('selected'); nodes.addClass('selected'); // the container html show me that the element has the class selected alert(container.html()); // webkit (chrome and safari) says that there are no elements inside of container with the class selected alert(containerSelecteds().length); // but the element exists in the dom, and it has the classname selected !! alert(bodySelecteds().length); }; var element = $('ul class=someclassliMyText/li/ul').appendTo(container); select(element, false); }); /script /head body div id=container style=border:1px solid #ccc;height:300px;width:300px/div /body /html I will try to explain the error: I'm inserting a node inside the container div, and applying a classname selected to this node. After this, I want to select the nodes inside container that have this classname. Firefox, IE, etc, says that there is one node inside container. But webkit browsers says that there is a node with this classname in the dom, but not inside container. I think that this is a quite simple css selector, so I don't know why it fails. Thanks. PD: it doesn't fails with jquery 1.2.6
[jQuery] Re: Simple selector not working in 1.3.1 and webkit (safari and chrome)
Try this: var containerSelecteds = function() { return $('ul.selected', container); }; I've had pretty good luck using that syntax instead of using .find() or .children(). It might solve the problem on safari (as I think the reason I stopped using find() or children() was that the above was much more reliable on my mac for doing dev work.) On Feb 3, 10:39 am, Javier Martinez ecentin...@gmail.com wrote: I'm creating a component for an application I'm developing and I have upgraded jquery to the last version to get it's speed boost. After some testing I have seen that my component is not working correctly in webkit browsers because there is some bug with the new Sizzle selector of the new jquery. I can't provide my source files, but I have created a simple test case that shows this error. !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en head meta http-equiv=Content-Type content=text/html; charset=utf-8 / script type=text/javascript src=jquery.js/script script type=text/javascript $(function() { var container = $('#container'); var containerSelecteds = function() { return container.find('ul.selected'); }; var bodySelecteds = function() { return $('ul.selected'); }; var select = function(nodes) { containerSelecteds().removeClass('selected'); nodes.addClass('selected'); // the container html show me that the element has the class selected alert(container.html()); // webkit (chrome and safari) says that there are no elements inside of container with the class selected alert(containerSelecteds().length); // but the element exists in the dom, and it has the classname selected !! alert(bodySelecteds().length); }; var element = $('ul class=someclassliMyText/li/ul').appendTo(container); select(element, false); }); /script /head body div id=container style=border:1px solid #ccc;height:300px;width:300px/div /body /html I will try to explain the error: I'm inserting a node inside the container div, and applying a classname selected to this node. After this, I want to select the nodes inside container that have this classname. Firefox, IE, etc, says that there is one node inside container. But webkit browsers says that there is a node with this classname in the dom, but not inside container. I think that this is a quite simple css selector, so I don't know why it fails. Thanks. PD: it doesn't fails with jquery 1.2.6
[jQuery] Re: Simple selector not working in 1.3.1 and webkit (safari and chrome)
Thanks for the fast response. Unfortunately it doesn't work :( 2009/2/3 Eric Garside gars...@gmail.com Try this: var containerSelecteds = function() { return $('ul.selected', container); }; I've had pretty good luck using that syntax instead of using .find() or .children(). It might solve the problem on safari (as I think the reason I stopped using find() or children() was that the above was much more reliable on my mac for doing dev work.) On Feb 3, 10:39 am, Javier Martinez ecentin...@gmail.com wrote: I'm creating a component for an application I'm developing and I have upgraded jquery to the last version to get it's speed boost. After some testing I have seen that my component is not working correctly in webkit browsers because there is some bug with the new Sizzle selector of the new jquery. I can't provide my source files, but I have created a simple test case that shows this error. !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en head meta http-equiv=Content-Type content=text/html; charset=utf-8 / script type=text/javascript src=jquery.js/script script type=text/javascript $(function() { var container = $('#container'); var containerSelecteds = function() { return container.find('ul.selected'); }; var bodySelecteds = function() { return $('ul.selected'); }; var select = function(nodes) { containerSelecteds().removeClass('selected'); nodes.addClass('selected'); // the container html show me that the element has the class selected alert(container.html()); // webkit (chrome and safari) says that there are no elements inside of container with the class selected alert(containerSelecteds().length); // but the element exists in the dom, and it has the classname selected !! alert(bodySelecteds().length); }; var element = $('ul class=someclassliMyText/li/ul').appendTo(container); select(element, false); }); /script /head body div id=container style=border:1px solid #ccc;height:300px;width:300px/div /body /html I will try to explain the error: I'm inserting a node inside the container div, and applying a classname selected to this node. After this, I want to select the nodes inside container that have this classname. Firefox, IE, etc, says that there is one node inside container. But webkit browsers says that there is a node with this classname in the dom, but not inside container. I think that this is a quite simple css selector, so I don't know why it fails. Thanks. PD: it doesn't fails with jquery 1.2.6
[jQuery] Re: Simple selector not working in 1.3.1 and webkit (safari and chrome)
That's odd. Could you file a bug on this? http://dev.jquery.com/newticket Thanks! --John On Tue, Feb 3, 2009 at 10:39 AM, Javier Martinez ecentin...@gmail.com wrote: I'm creating a component for an application I'm developing and I have upgraded jquery to the last version to get it's speed boost. After some testing I have seen that my component is not working correctly in webkit browsers because there is some bug with the new Sizzle selector of the new jquery. I can't provide my source files, but I have created a simple test case that shows this error. !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en head meta http-equiv=Content-Type content=text/html; charset=utf-8 / script type=text/javascript src=jquery.js/script script type=text/javascript $(function() { var container = $('#container'); var containerSelecteds = function() { return container.find('ul.selected'); }; var bodySelecteds = function() { return $('ul.selected'); }; var select = function(nodes) { containerSelecteds().removeClass('selected'); nodes.addClass('selected'); // the container html show me that the element has the class selected alert(container.html()); // webkit (chrome and safari) says that there are no elements inside of container with the class selected alert(containerSelecteds().length); // but the element exists in the dom, and it has the classname selected !! alert(bodySelecteds().length); }; var element = $('ul class=someclassliMyText/li/ul').appendTo(container); select(element, false); }); /script /head body div id=container style=border:1px solid #ccc;height:300px;width:300px/div /body /html I will try to explain the error: I'm inserting a node inside the container div, and applying a classname selected to this node. After this, I want to select the nodes inside container that have this classname. Firefox, IE, etc, says that there is one node inside container. But webkit browsers says that there is a node with this classname in the dom, but not inside container. I think that this is a quite simple css selector, so I don't know why it fails. Thanks. PD: it doesn't fails with jquery 1.2.6
[jQuery] Re: :not selector --- not working
That's an XPath selector, not a CSS selector. To do that in jQuery you would need to do: $(tr:not(:has(th)):even) --John On Dec 20, 9:38 am, chinnakarup...@gmail.com chinnakarup...@gmail.com wrote: Hi, I tried a eg for :not operator.According to which it should not pick up the Table header but it does .what am i missing. One more question what is the significance of putting the 'th' in the square bracket .is it OK to write like this. $('tr:not(th):even').addClass('even'); THnks !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / titleNew Web Project/title style type='text/css' .even{ background-color:blue; } /style script type=text/javascript src=/lib/jquery/ jquery.js/script script type=text/javascript $(document).ready(function(){ $('tr:not([th]):even').addClass('even'); }) /script /head body table tr thTitle/th thCategory/th /tr tr tdAs You Like It/td tdComedy/td/tr tr tdAll's Well that Ends Well/td tdComedy/td/tr tr tdHamlet/td tdTragedy/td/tr tr tdMacbeth/td tdTragedy/td/tr tr tdRomeo and Juliet/td tdTragedy/td/tr tr tdHenry IV, Part I/td tdHistory/td/tr tr tdHenry V/td tdHistory/td/tr /table /body /html