[jQuery] JQuery Xpath working?

2007-03-02 Thread Jeff Lawson
Hi, I'm having trouble getting xpath selectors to work well, particularly on XML responses from ajax requests, using FF. Hoping somebody can help. Here are the steps I'm taking: 1. Perform an ajax request using Prototype's Ajax.request, with an onComplete callback to my function.

[jQuery] Xpath and tab selection

2006-11-02 Thread radius
So I have a tabbed navigation system, and I am using jquery to auto-select the current tab. Here's the html: ul id=main_nav li /services/ SERVICES /li li /store/ STORE /li li /about-us/ ABOUT US /li li /gallery/ GALLERY /li li /press/ PRESS /li /ul Here's my jQuery code (adapted

Re: [jQuery] Xpath and tab selection

2006-11-02 Thread Brian Miller
Darius, $= means attribute ends with. Check out http://jquery.com/docs/Base/Expression/CSS/ , the Supported, but different section. Taking a close look at the selection documentation might also help you with item #2 a bit. You're going to have to figure out how to text-match your relative URL

Re: [jQuery] Xpath and tab selection

2006-11-02 Thread radius
Thanks a bunch for that link, Brian. I really did search the documentation, and I feel crazy for missing that rather obvious link from the XPath section. I ended up going the less-than-elegant route and breaking out of jQuery to use the JS match() function, but it works nicely: if

Re: [jQuery] XPath query whoas/bugs?

2006-10-15 Thread Jörn Zaefferer
Stephen Woodbridge schrieb: John, Thank you for looking at this. Removing the '//' helps a little. Now both the alerts work in FF, and in IE6 it no longer throws an error, but both of the searches in IE6 appear to return a null string (ie: '') Also changing the first alert to: alert(' +

Re: [jQuery] XPath query whoas/bugs?

2006-10-15 Thread John Resig
Jörn - #164 is not yet resolved, see my latest comment there. http://jquery.com/dev/bugs/bug/164/ IE reacts really weird when using getAttribute on an XML element. Looks like we need some more workarounds. That code has already been changed in SVN. Please make sure that you're current. I

Re: [jQuery] XPath query whoas/bugs?

2006-10-15 Thread Stephen Woodbridge
John Resig wrote: Jörn - #164 is not yet resolved, see my latest comment there. http://jquery.com/dev/bugs/bug/164/ IE reacts really weird when using getAttribute on an XML element. Looks like we need some more workarounds. That code has already been changed in SVN. Please make sure that

Re: [jQuery] XPath query whoas/bugs?

2006-10-15 Thread Stephen Woodbridge
John Resig wrote: Just grabbed svn and $(document).ready(function(){alert(hello)}); does not fire on IE. Sorry about that, it's now fixed in SVN rev 442. NP, thanks for the updates. OK, this is good in FF, in IE6 no errors, but returns a '' for the xpath queries instead of the correct

Re: [jQuery] XPath query whoas/bugs?

2006-10-14 Thread John Resig
Stephen - After doing some testing, it seems as if the culprit is the '//' that you have in front of your expression. It's perfectly ok to remove it - as it will continue to work correctly. It seems to be that if you do .find(//foo) or $(//foo, context) it freaks out. But this is ok, since doing

Re: [jQuery] XPath query whoas/bugs?

2006-10-14 Thread Stephen Woodbridge
John, Thank you for looking at this. Removing the '//' helps a little. Now both the alerts work in FF, and in IE6 it no longer throws an error, but both of the searches in IE6 appear to return a null string (ie: '') Also changing the first alert to: alert(' + $('/html/body/xml/[EMAIL

[jQuery] XPath expressions not working

2006-10-03 Thread Raziel Alvarez
I've been testing and I see many really simple XPath queries that just don't work, or they even break. Is this broken in jQuery? Are they working for somebody? thanks ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/

Re: [jQuery] XPath expressions not working

2006-10-03 Thread Jörn Zaefferer
Raziel Alvarez schrieb: I've been testing and I see many really simple XPath queries that just don't work, or they even break. Is this broken in jQuery? Are they working for somebody? jQuery does not claim to implement the XPath standard. It just supports a small subset, and these should

Re: [jQuery] XPath expressions not working

2006-10-03 Thread Raziel Alvarez
I sent an email yesterday, but maybe it didn't got through. Anyway, this is it: I have this simple markup: componentDom.innerHTML = form action=""> h1 name=formTitle/h1 p name=formInstructions/p div name=top /div div name=formContent divname=columndiv /div/div /div div name=bottom input

[jQuery] XPath Axes: ancestor(-or-self) / parents / descendent / children

2006-09-25 Thread George Adamson
I'm interested to know how to extend the selector syntax to accept things like axis definitions etc. (I know from the forum that we should be using the .parents() methods etc but I'd like to extend the selector syntax myself.) While the .parent() and .children() methods etc work very well when

Re: [jQuery] XPath '[EMAIL PROTECTED]' doesn't work on XML documents

2006-09-11 Thread Mark Gibson
Mark Gibson wrote: John Resig wrote: Just a hunch, but IE's DOM support isn't native Javascript. If they got their typelib wrong it may be trying to call getAttribute rather than check elem for a getAttribute property. Can you replace that last line with this and see if it works? }

[jQuery] XPath '[EMAIL PROTECTED]' doesn't work on XML documents

2006-09-08 Thread Mark Gibson
Hello, I've come across a strange bug in IE: I've loaded an XML doc using $.get(), and selecting nodes using an XPath with a predicate containing an attribute: $([EMAIL PROTECTED], xml) IE just throws a wobbly: Line: 639 Error: Wrong number of arguments or invalid property assignment

Re: [jQuery] XPath '[EMAIL PROTECTED]' doesn't work on XML documents

2006-09-08 Thread Ian B
Mark Yes - I flagged this up a few days ago http://www.nabble.com/Searching-for-XML-attribute-tf2215205.html Link Here Still waiting for resolution - don't know if I need to raise a bug report... Ian Mark Gibson-8 wrote: Hello, I've come across a strange bug in IE: I've loaded an XML

Re: [jQuery] XPath '[EMAIL PROTECTED]' doesn't work on XML documents

2006-09-08 Thread Dave Methvin
IE just throws a wobbly: Line: 639 Error: Wrong number of arguments or invalid property assignment which appears to reside in the 'attr' function, the line is: } else if ( elem.getAttribute ) { Just a hunch, but IE's DOM support isn't native Javascript. If they got

Re: [jQuery] XPath '[EMAIL PROTECTED]' doesn't work on XML documents

2006-09-08 Thread John Resig
Just a hunch, but IE's DOM support isn't native Javascript. If they got their typelib wrong it may be trying to call getAttribute rather than check elem for a getAttribute property. Can you replace that last line with this and see if it works? } else if ( typeof(elem.getAttribute) !=

[jQuery] xPath

2006-09-03 Thread Sam
Newbie question: Can I use jQuery's xPath capability to locate an element in an arbitrary XML file loaded using Ajax? Sam ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/

Re: [jQuery] xPath

2006-09-03 Thread Christof Donat
Hi, Can I use jQuery's xPath capability to locate an element in an arbitrary XML file loaded using Ajax? Yes: $('/my/[EMAIL PROTECTED]',XMLDOMDocument) Christof ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/

Re: [jQuery] xPath

2006-09-03 Thread John Resig
Can I use jQuery's xPath capability to locate an element in an arbitrary XML file loaded using Ajax? Yes! For example: $.post(test.xml,function(data){ $(//foo/bar,data).each( ... ); // or, with CSS: $(foo bar).each( ... ); }); It's important to note that jQuery only supports a very

Re: [jQuery] XPath

2006-08-15 Thread Fil
I want the expression to verify that the link is in the correct data structure, i.e. inside a dt that is inside a dl and where $(this).parent().next() is a dd. Said differently: I want to tell my script if the link is inside a dt then show() the corresponding dd (if it exists). That's why I was

Re: [jQuery] XPath

2006-08-15 Thread kenton.simpson
$(dl dt a).click(function (event) { event.preventDefault(); event.stopPropagation(); $(this).parent().next().show(); }); Fil wrote: I want the expression to verify that the link is in the correct data structure, i.e. inside a dt that is inside a dl and where

Re: [jQuery] XPath

2006-08-14 Thread John Resig
In the SVN build of jQuery you can do: $(this).parent().next().show(); jQuery SVN can be found here: http://jquery.com/src/jquery-svn.js --John I have the following structure: dl dta href=urlx/a/dt ddtext/dd /dl I select the a element in this, and I want to