Page 1 of 1

application/ld+json script in head element

Posted: Fri Mar 23, 2018 9:02 pm
by TomHTML
I'm employing an application/ld+json script with schema information, including a bread crumb list, etc., in the head element. The validator responds to it this way:
When designing web pages, consider that scripts and programmatic objects pose potential accessibility problems for users: 1) some user agents, like the Lynx text-only browser, do not support scripts, 2) scripts can cause problems with screen readers, 3) some users disable scripts even though their user agent supports them, and 4) scripts are sometimes disabled in schools, libraries, and public access places.
Provided the importance of schema info in such a script block, might the validator not issue this particular warning? (Or are application/ld+json scripts posing a problem for screen readers, etc., in a way that could be handled better by the HTML coder? If so, how? (Is there an ARIA attribute that could be applied to the script tag itself to solve this? I can't think of one.)

Many thanks!

Re: application/ld+json script in head element

Posted: Mon Mar 26, 2018 9:54 am
by Albert Wiersch

That should be a regular message (not an error and not a warning).

I've changed it so that future updates will not generate this message for script elements that don't actually contain script (like when type="application/ld+json").