Ticket #2529518 (closed defect)

Reporter


Ricardo Ramirez
Opened: 11/9/10
Last modified: 08/18/11
Status: closed
Type: defect
Resolution: fixed

Owner


Matt Sweeney
Target Release: 3.4.0
Priority: P3 (normal)
Summary: Y.one() failing when getting an id that includes a colon
Description:

In the following call, w successfully gets the element, and z does not:


YUI().use('dom','node', function(Y) {
var w = document.getElementById('hello:1');
console.log('Hello:1 is: ' + w);
var z = Y.one('#hello:1');
console.log('Hello:1 is: ' + z);
});

This is important because Frameworks like MyFaces in JavaServer faces autogenerate the ids, and separate them using semicolons, for example, it is pretty common to see content generated as

<table id='myIdentifier'>
<tr id='myIdentifier:1'>
<td></td>
</tr>
<tr id='myIdentifier:2'>
<td></td>
</tr>
</table>

I tried searching if a colon was an invalid identifier, DOM does not seem to say anything about that
http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-637646024

Since some frameworks use it, it would be nice for YUI to be able to retrieve those id, it makes integrating YUI with JavaServer faces difficult.

Type: defect Observed in Version: 3.2.0
Component: Selector Severity: S3 (normal)
Assigned To: Matt Sweeney Target Release: 3.4.0
Location: Library Code Priority: P3 (normal)
Tags: dom,node Relates To:
Browsers: Firefox 3.x - All
URL:
Test Information:

Change History

Ricardo Ramirez

YUI Contributor

Posted: 11/9/10

Forgot to say, the element is declared in the page as

<div id='hello:1'></div>

Matt Sweeney

YUI Developer

Posted: 12/8/10
  • milestone changed to 3.NEXT
  • priority changed to P3 (normal)
  • status changed from new to accepted

Matt Sweeney

YUI Developer

Posted: 01/26/11
  • component changed from Node to Selector
  • location changed to Library Code
  • owner changed from Matt Sweeney to Matt Sweeney
  • status changed from accepted to assigned

Matt Sweeney

YUI Developer

Posted: 04/28/11
  • milestone changed from 3.NEXT to 3.4.0
  • status changed from assigned to accepted

George

YUI Developer

Posted: 04/29/11
  • milestone changed from 3.4.0 to 3.4.0 PR1

Matt Sweeney

YUI Developer

Posted: 05/24/11
  • status changed from accepted to checkedin

George

YUI Developer

Posted: 06/8/11
  • milestone changed from 3.4.0 PR1 to 3.4.0

George

YUI Developer

Posted: 06/8/11
  • sprint changed to sprint 1

George

YUI Developer

Posted: 08/18/11
  • resolution changed to fixed
  • status changed from checkedin to closed