Community
Participate
Working Groups
see 120961 for how I'm currently identifying SCRIPT tags within an HTML document It would be nice to have a formal API abstracting this, but also to return SCRIPT which is inside HTML attributes (anything defined as Script by the HTML DTD) For completeness, the ideal API would also provide the type of any of this script, as defined by type attributes or defaults in the HTML document. Hopefully this would be available to JSP, XHTML or other HTML-derived documents as well.
if it is possible to identify the script attributes through current APIs, please let me know. thanks
oh yeah, forgot to mention that the line number and offset are also needed, which I think is what prevented me from just walking the DOM in the first place.
My guess is we have half a dozon internal ways of doing this ... and its a fair request to settle on one as the API way to do it.
David, short of revamping the APIs, is there currently a way to identify HTML attributes which are of type script? (e.g. onClick="...")
When designing the API for this bug, the API should also handle the bug 108860. As additional script languages are supported in html files (php, python, etc), the validators for those languages will need to be able to process their regions. These script languages will use different tags to specify their regions. For example, some of possible php tags are <?php ?>, <? ?> and <%php %>.
Can't promise we'll have time to do it ourselves (high quality patches welcomed!), but we'll try to look at it for 3.0.
Is this API something that would still be useful?
Resolving. Please reopen if it's still wanted. Comment 5 sounded like a different function altogether.