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.
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
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
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
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(' +
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
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
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
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
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
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/
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
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
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
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?
}
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
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
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
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) !=
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/
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/
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
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
$(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
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
25 matches
Mail list logo