Skip to main content

Bug Tracker

Side navigation

#11296 closed bug (invalid)

Opened February 07, 2012 03:50PM UTC

Closed February 07, 2012 03:54PM UTC

Last modified November 14, 2012 04:58PM UTC

$ selector for base64'd id

Reported by: aprilkacau@gmail.com Owned by: aprilkacau@gmail.com
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:
Description

I have rows of data in a table, each row have an id that's basically an base64'd string for the appropriate item's key in a huge array collection.

Basically, if I do this:

document.getElementById('MU4yRC50eHQ=')

there's one exact and correct match.

But when doing this:

$('#MU4yRC50eHQ=')

nothing returned

I checked the problematic html structures through W3 HTML validator as HTML5 DOCTYPE, and it passed, so I assumed that using base64'd string as an element ID is valid.

I really hate to submit this as a bug, but I have nowhere else to ask, although I'd probably end up using document.getElementId, I guess there's no harm mentioning this to the jQuery's dev team :)

Attachments (0)
Change History (6)

Changed February 07, 2012 03:53PM UTC by sindresorhus comment:1

owner: → aprilkacau@gmail.com
status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

Changed February 07, 2012 03:54PM UTC by dmethvin comment:2

resolution: → invalid
status: pendingclosed
I really hate to submit this as a bug, but I have nowhere else to ask

Try StackOverflow or http://forum.jquery.com .

Hint: "=" is a special character.

Changed November 14, 2012 01:29PM UTC by anonymous comment:3

workaround: $("[id='MU4yRC50eHQ=']") will select your div

Changed November 14, 2012 03:28PM UTC by timmywil comment:4

You're using the wrong validator. Treat the jQuery constructor like document.querySelectorAll, not like document.getElementById. Special characters must be escaped:

http://jsbin.com/evilid/1/

Changed November 14, 2012 04:31PM UTC by aprilkacau comment:5

HINT: 9 MONTHS AGO

Changed November 14, 2012 04:58PM UTC by timmywil comment:6

@aprilkacau: the comments are not only for the operator, but everyone who stumbles upon these tickets on google.