Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace document.write with something that makes ReSpec work with XHTML files #157

Closed
komputist opened this issue Mar 6, 2013 · 4 comments

Comments

@komputist
Copy link

As of ReSpec 3.1.46, the script contains several document.write statements. This makes the script fail with the message "INVALID_STATE_ERR: DOM Exception 11: An attempt was made to use an object that is not, or is no longer, usable" if one tries to apply the script to an XHTML document (a document consumed as application/xhtml+xml).

@darobin
Copy link
Member

darobin commented Mar 6, 2013

Can you point at specific instances of this in the code?

Note that supporting XHTML is not particularly a goal, the authoring format is meant to be HTML5. (But if there's a simple change that can make it work, then it can be applied for sure.)

@komputist
Copy link
Author

There are 5 instances of document.write in http://darobin.github.com/respec/builds/respec-w3c-common.js

The general advice is to use the innerHTML property instead.
http://www.w3.org/TR/html-polyglot/#script-and-style

@komputist
Copy link
Author

Hm, I should probably have pointed to js/w3c/legacy.js — that’s where all the document.write statemens I’ve found are – https://github.com/darobin/respec/blob/develop/js/w3c/legacy.js

@darobin
Copy link
Member

darobin commented Sep 2, 2013

Outside discussion has shown this not to be the issue.

@darobin darobin closed this as completed Sep 2, 2013
shikhar-scs pushed a commit to shikhar-scs/respec that referenced this issue Feb 19, 2018
shikhar-scs pushed a commit to shikhar-scs/respec that referenced this issue Feb 19, 2018
shikhar-scs pushed a commit to shikhar-scs/respec that referenced this issue Feb 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants