Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

jqLite('<div>') throws an error in an XHTML document #6917

Closed
@Arnavion

Description

@Arnavion

This one. There are a few in test/jqLiteSpec.js as well.

For example, the error on Chrome is Error: Failed to set the 'innerHTML' property on 'Element': The provided markup is invalid XML, and therefore cannot be inserted into an XML document.

The reason is that the implementation of jqLite tries to set innerHTML to that argument on this line div.innerHTML = '<div>&#160;</div>' + element; (where element is '<div>') and this is malformed without a closing </div> at the end.

It is trivial to test: just call jqLite('<div>') and see if it throws the above error.

I found this issue with its associated commit that seems to indicate the author knew about this problem but I suppose they didn't actually test it in XHTML.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions