As of Summer '17 with locker service and with "Enable Stricter CSP for Lightning Components" Enabled it will no longer be supported. the documentation lists supported tags and attributes as well as an IMPORTANT note.
Important: With the "Enable Stricter CSP for Lightning Components in
Communities" critical update, you have control over whether to enforce
stricter CSP. When stricter CSP is activated, some of your existing
head markup may not work correctly. Test your markup in your sandbox
or DE orgs first before activating in live orgs in a future release.
For security purposes, we restrict the tags, attributes, and values
allowed in the head markup of your pages
as, charset, crossorigin, disabled, href,
hreflang, id, import, integrity, media, rel, relList, rev, sheet,
sizes, target, title, type
**For rel, allowed values are alternate:
precomposed, apple-touch-startup-image, author, bookmark, external,
help, icon, license, manifest, mask-icon, next, nofollow, noopener,
noreferrer, pingback, prefetch, preload, prev, search, shortcut icon,
stylesheet, and tag.
charset, content, http-equiv,2 name, scheme
**For http-equiv, allowed values are cleartype, content-type,
content-language, and default-style.
You will have to monitor and check for critical updates and decide which ones to enable/disable.
added based on comments
You should not use direct
#(Id selector) and
.(class selector) selectors in jquery (or any other library) as that will cross the component boundary. You should instead use
$(component.find('initid').getElement())which will respect component boundary.
Once the library is loaded
$is available throughout. Also there is no need of
onreadyas you are already invoking the function on
Below is the sample script:
I just tested in my org with below code:
And got below log:
This means it is working in community - even when I login as community user.