dojo.query not working for attribute selector that includes a tilde (~) character
I need to select a link node given its url. Using an attribute selector works quite well except for a few rare cases when the url has a tilda. I have no control over the link urls. Here is an example:
<script>
dojo.ready(function() {
var node = dojo.query('a[href="http://abc.com/~123"]')[0];
console.debug(node);
node = dojo.query('a[href="http://abc.com/_123"]')[0];
console.debug(node);
});
</script>
...
<body>
<a href="http://abc.com/~123">link 1</a>
<a href="http://abc.com/_123">link 2</a>
</body>
This prints:
undef开发者_StackOverflow中文版ined
<a href="http://abc.com/_123">
I looked at the level 3 selectors spec and didn't find anything on the tilde character being unsupported for attribute selector values which are just CSS strings.
Help!
This appears to have been fixed in 1.6 http://bugs.dojotoolkit.org/ticket/10651
精彩评论