Why do Google Websites like YouTube use duplicate id attributes everywhere [closed] - javascript

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
Websites like YouTube for example I see all throughout their HTML duplicate id attributes. For example on a YouTube channel videos page you see: id="dismissable", id="video-title", and id="meta" on literally all of the videos. This is just a small selection. I don't get it. Isn't this invalid code. I guess if you aren't trying to query a selector by id in JavaScript and just using the ids for CSS selection then it doesn't matter?
Any idea why they might be doing this? Did they run out of classes to use or wanted to use selectors with higher specificity?

Related

How does soundcloud generate their html? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Today I was inspecting the soundcloud source-html through chrome, but it only returned a basic(very small) html dom.
So I was wondering how do they generate their html?
I'm curious because soundcloud is a pretty big website and I doubt they generate all the html though javascript, but when I checked their javascript I could not find any <div tags or anything like that.
For larger dynamic websites usually a template framework is used like EJS - http://www.embeddedjs.com/
With templating you can embed JavaScript logic directly into the HTML so it changes and updates dynamically.

How does this example receive information from YouTube? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I am new to JS/HTML. I am fluent in Java, C++, C, and ok in Assembly. I am trying to encode this in my website:
http://jsfiddle.net/NmvA9/7743/
<html>
I understand for the most part what is going on (colors, sizes, basic code flow, etc.)
What I cant figure out is how to get it to display 'my' playlist instead of the example playlist. I don't see where the code points to a channel/playlist.
I don't see any playlist id or video ids in the code.
Where does this example point to YouTube?
$('#player').youTubeChannel({
user: 'putyouryoutubeusernamehere'
});

Optimizing pages from side of javascript [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I need to know about two things. I was looking on google but I could not found any good.
First thing is: Location of the scripts in the structure of documents.
Can anyone explain to me what's going on? How it works to optimize pages and where you should put the scripts?
Second thing is: Packing and compressing js code.
I find some packers in google like this: http://dean.edwards.name/packer/ but how its work? All writen scripts should pack?
Please for an explanation or some link to article.
Concerning your first point, one answer to look at would be this one:
https://stackoverflow.com/a/24070373/1145461
Concerning the 2nd point, hopefully this link will help:
http://en.wikipedia.org/wiki/Minification_(programming)

How can I do a if then statement in javascript between websites? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I am trying to make a website that depends on another website.
If this other website has a certain word written on the index page at the time, then the text on my website says Yes, if it doesn't have that word, then the font on my website says No.
How can I do this?
You'd have to do that through a server side code, which can do cross-domain GET requests for the target websites, check for your desired word and then display the result on your website. You can use php, aspx.net and many more.

Javascript tool/website for sharing scripts and developing [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I'm looking for a website/service were I can develop and share my Javascript code with others. I had a site open in browser the other which did it nicely, but after searching my history and googling around for half an hour, I can't find anything.
The site I saw was split into four areas: html, css, javascript and result..
Anybody know a site like that?
JSFiddle is what you're looking for.
http://jsfiddle.net
JSFiddle
Note that at times when JSFiddle is slow, you might want to use JSBin.

Categories

Resources