Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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&lt;/a>
    <a href="http://abc.com/_123">link 2&lt;/a>
</body>

This prints:

undefined
<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!

like image 233
Lightbeard Avatar asked Nov 14 '22 13:11

Lightbeard


1 Answers

This appears to have been fixed in 1.6 http://bugs.dojotoolkit.org/ticket/10651

like image 186
jcolebrand Avatar answered Dec 04 '22 07:12

jcolebrand