4

I know requiring javascript on a webpage has been a hot topic the last couple years.

I'm wondering if someone wanted to use custom elements but still allow the website to be usable without javascript how would they do that?

Would they have to add a <noscript> with regular elements? or is there some way for browsers to know what to fall back to if a custom element is used but javascript isn't enabled?

asked Oct 26, 2016 at 21:16
10
  • What are you trying to accomplish? Are you trying to figure out what happens to your tags with JavaScript disabled? Commented Oct 26, 2016 at 23:34
  • I'm wondering what the best practice would be for someone who wants to use the new web components standard and still provide a usable experience for people who don't want to use javascript Commented Oct 27, 2016 at 4:14
  • The answer to most questions along the line "I want to do fancy stuff with JS but only as progressive enhancement" is "server-side rendering". Commented Oct 27, 2016 at 8:22
  • 1
    This question should be asked at stackoverflow.com Commented Jun 9, 2017 at 14:57
  • 1
    @TheCatWhisperer The top two tags on this site are "java" and "c#" I can almost guarantee none of those questions are language agnostic. Is there somewhere on this site that explains what a good/bad question for this site is? Commented Jun 14, 2017 at 21:31

1 Answer 1

1

Unfortunately, custom elements were not designed to be created with html-only syntax1. They were created with the idea to change the DOM on the fly and add your own elements by javascript only.

answered Jun 9, 2017 at 8:27

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.