Linked Questions

1 vote
1 answer
654 views

Does JavaScript have an order of precedence like CSS? [duplicate]

Does JavaScript behave like CSS in that on-page scripts will take a higher precedence over external scripts? The reason I ask is because I am wondering if I can override an external script's commands ...
huzzah's user avatar
  • 1,805
0 votes
2 answers
2k views

Uncaught Reference Error : $ is not defined? [duplicate]

I am beginner in JavaScript and Html. Currently I am learning to make chrome extensions. My manifest.json file is like this: { "manifest_version": 2, "name": "Hello World", "version": "...
user avatar
0 votes
2 answers
235 views

Script parsing order in HTML [duplicate]

Browser loading scripts <!DOCTYPE html> <html dir="ltr"> <head> <script type="text/javascript" src='./value-of-a-is-1.js'></script> <!-- Loads slow as per network tab ...
Gyandeep's user avatar
  • 13.7k
0 votes
1 answer
221 views

How to Make the Accordion FAQ Pop Out Below? [duplicate]

I've been making an Accordion-style FAQ for a website I'm building. I imported the JavaScript code and linked it to the main HTML file to make the motion of popping out the FAQ below when it is ...
Sarah's user avatar
  • 61
0 votes
1 answer
166 views

When exactly are javascripts parsed and interpreted? [duplicate]

Please feel free to close this question if it is a duplicate(I could not find a question which exactly answers this.) Experts always recommend to place all your javascript files at the bottom of the ...
letsc's user avatar
  • 2,115
3 votes
0 answers
109 views

Why is the result different to what I expected? [duplicate]

<head> <script src="1.js"></script> </head> <body> <script src="3.js"></script> </body> //js1.js let head = document....
tonitone120's user avatar
  • 2,450
0 votes
1 answer
61 views

Is the order of evaluation defined by a specification for JavaScripts in a page [duplicate]

If I include two scripts like so (one directly in the page, one in a remote resource): <!-- ... --> <script> console.log('foo'); </script> <script src="bar.js"></script&...
Ben Aston's user avatar
  • 56k
0 votes
0 answers
56 views

What does "async" do when added in a javascript script tag? [duplicate]

So, I was watching a youtube video about how to make a page load faster. Around 1.56 explains that adding async to a script tag like so <script src=javascriptfile.js async></script> does ...
slevin's user avatar
  • 3,976
0 votes
0 answers
40 views

Will JavaScript always be executed before the web page finishes loading if it is placed in the ```<head>```? [duplicate]

I was wondering if the statement is true or false just to be sure. I answer similar question online with true, but the correct answer stated the statement is false.
haikhalfakhreez's user avatar
0 votes
0 answers
24 views

Question about Javascript code execution speed regarding the order in which their file are declared [duplicate]

Does the order of javascript files affect the actual speed of the scripts? I am thinking that maybe the browser would be able to read first the scripts in the first file like if you have 5 js files ...
Kolektador's user avatar
872 votes
13 answers
432k views

Script Tag - async & defer

I have a couple of questions about the attributes async & defer for the <script> tag which to my understanding only works in HTML5 browsers. One of my sites has two external JavaScript files ...
Adam's user avatar
  • 21.1k
122 votes
10 answers
75k views

How to defer inline Javascript?

I have the following html code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <script src="https://cdn....
user31782's user avatar
  • 7,797
69 votes
11 answers
78k views

Does javascript have to be in the head tags?

I believe javascript can be anywhere (almost), but I almost always see it in between <head></head>. I am using jquery and wanted to know if it has to be in the head tags for some reason ...
johnny's user avatar
  • 19.9k
94 votes
6 answers
105k views

Nested ES6 classes?

It seems possible to nest a class in a constructor which can then be instantiated from anywhere within the class, is this official? [EDIT] E.g., class C { constructor() { class D { ...
user5321531's user avatar
  • 3,275
53 votes
7 answers
65k views

Google Analytics Code Explanation

Can someone explain this code 'step by step','line by line'? I would like to learn more about Asynch code and how Google loads their script, how to 'hide' javascrippt from users (I know that I can't ...
Milos Sretin's user avatar
  • 1,758

15 30 50 per page
1
2 3 4 5
7