[jQuery] Re: jQuery syntax question

2009-07-14 Thread Matthew
Hi Ricardo, thanks for the clarification, i thought I rememberd seeing the $( $(x)[2] ) syntax somewhere. I like that better than the eq(). My ID's are all good, I just needed the 'body#seniors #text' so only pages in my senior section would be altered, but I guess doing a php if/else would have b

[jQuery] Re: jQuery syntax question

2009-07-13 Thread Ricardo
Well, $( $(x)[2] ) is exactly the same as $(x).eq(2), and eq() is way slower cause it needs to preserve the object and stuff. The point everyone missed is that $(x)[2] gives you a DOM element, not a jQuery object, that's why you need to "rewrap" it in jQuery. Also, IDs should be unique (only one

[jQuery] Re: jQuery syntax question

2009-07-13 Thread Matthew
nevermind my last reply, eq() works great, I just forgot to change my code... here is the code snipet that works (for future reference) jQuery.get("http://www.online-health-insurance.apollobackstage.com/ includes/seniorFreeQuoteBody.php", function(data){ $(

[jQuery] Re: jQuery syntax question

2009-07-13 Thread Matthew
Ok, so eq() seems to work fine, I tried nth-child but im not sure if it worked the way I wanted. When I console.log eq() for the code snipet I provided i get "[p]" does that look right? Here is a DOM example from my page: ... ... .. ... ... ... ... ... Here is my goal with eq(), Im trying

[jQuery] Re: jQuery syntax question

2009-07-13 Thread James
The eq() selector is one way of doing it: http://docs.jquery.com/Selectors/eq On Jul 13, 9:09 am, Matthew wrote: > So it seems like everyday I learn a new way to code the same thing. > What I am trying to do is add some code after a paragraph depending on > how many paragraphs are in the content

[jQuery] Re: jQuery syntax question

2009-07-13 Thread MorningZ
$("p", "body#seniors #text")[2]. does not mean "third paragraph" "nth-child" would be what you could use http://docs.jquery.com/Selectors/nthChild#index On Jul 13, 3:09 pm, Matthew wrote: > So it seems like everyday I learn a new way to code the same thing. > What I am trying to do is add

[jQuery] Re: jQuery syntax question

2009-07-13 Thread Matt Zagrabelny
On Mon, 2009-07-13 at 12:09 -0700, Matthew wrote: > So it seems like everyday I learn a new way to code the same thing. > What I am trying to do is add some code after a paragraph depending on > how many paragraphs are in the content. I'm not to worried about logic > right now just syntax. Here is

[jQuery] Re: jQuery syntax

2009-06-17 Thread cz231
Hi, Thanks for the reply. After some investigation, I found that in my xml file it said: So just for kicks I put dataType:"text/xsl" And I think I made progress, but I'm not sure. Because now, it creates the div.panel-previews for each xml node, but for some reason doesn't fill in any of the

[jQuery] Re: jQuery syntax

2009-06-16 Thread James
IE seems to have a problem with returning the correct header for the XML content-type. You'd have to either have the server force the content-type text/xml for .xml files, or if generated through a script (e.g. PHP) have the script set the header content-type when serving the XML. I've came upon a