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

meta-example.html has problem #13

Open
modoojunko opened this issue Feb 18, 2022 · 1 comment
Open

meta-example.html has problem #13

modoojunko opened this issue Feb 18, 2022 · 1 comment

Comments

@modoojunko
Copy link

modoojunko commented Feb 18, 2022

I follow the steps
image
and add <script> and <style>
I can not get same result like that.

So I checked. the console gives this error
image

I found some pages that said <script> should be after the body.

I tried it works.

In the meta-example.html there has "defer". It means after HTML body loaded , load this.
<script src="script.js" defer></script>

My point is this, learn page does not include what is defer means.

could you add this defer information on MDN learn page? (https://developer.mozilla.org/zh-CN/docs/learn/HTML/Introduction_to_HTML/The_head_metadata_in_HTML)

@Cjiangha
Copy link

Cjiangha commented Jul 18, 2022

the javascipt is not find the body' label when it happened .
you can try to use the way after.

document.querySelector('body')
// not document.body, I think

let it try.

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