[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. Here's

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 (locat

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 U

[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: /services/ SERVICES /store/ STORE /about-us/ ABOUT US /gallery/ GALLERY /press/ PRESS Here's my jQuery code (adapted from http://leftlogic.com/info/articles?id=1):

Re: [jQuery] XPath query whoas/bugs?

2006-10-15 Thread John Resig
> I have revision 442, but there are still severe problems in IE6. There > is an error on first page load, the second attr(String, Object) test > fails completely, find dies at test #34. Third $.load and third $.ajax > tests die, too. I'll try to get that MS Script Debugger, but until then, > I hav

Re: [jQuery] XPath query whoas/bugs?

2006-10-15 Thread Jörn Zaefferer
John Resig schrieb: > 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 SV

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 corre

Re: [jQuery] XPath query whoas/bugs?

2006-10-15 Thread John Resig
> 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. --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/

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 mak

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 Klaus Hartl
Jörn Zaefferer schrieb: > 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

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: > > a

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 PROTEC

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 do

[jQuery] XPath query whoas/bugs?

2006-10-14 Thread Stephen Woodbridge
Hi all, I am trying to figure out xpath queries, but I am missing something and/or running into bugs. John pointed me at Bug #164, which has been closed, but I still have problems. Here is a simple script with two alerts. Each alert should report "United States" from the embedded xml. o The 1s

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 =                            I'm executing this xpath calls with the following results:    $('form/[EMAIL PROTECTED]', componentDom).length = 3  $('form/[EMA

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 shoul

[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/

[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 co

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

2006-09-11 Thread John Resig
> Sorry, I got this wrong - it doesn't force case sensitive. > > According to the docs: > 2 - Returns the value exactly as it was set in script or in the source > document. > > Now I'm even more confused, what else would it return? Specifically, this relates to the 'href' attribute - since browser

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?

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

2006-09-11 Thread Mark Gibson
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? >> >> } else if (

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.getAttribut

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 g

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

[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 w

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

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/

[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-08-18 Thread John Resig
Or, more simply: $("dl dt a").click(function(){ $(this).parent().next().show(); return false; }); --John ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/

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 that is inside a and where > $(this).parent().ne

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 that is inside a and where $(this).parent().next() is a . Said differently: I want to tell my script "if the link is inside a then show() the corresponding (if it exists)". That's why I was trying t

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: > > > x > text > > > > I select the element in this, and I want to show() the corresponding

[jQuery] XPath

2006-08-14 Thread Fil
Hello I have the following structure: x text I select the element in this, and I want to show() the corresponding dd. This works but is not very precise: $("../../dt/../dd", this).show(); I'm trying to write it more precisely with something like: $("