web-standards

Blank image encoded as data-uri [duplicate]

六眼飞鱼酱① 提交于 2019-11-29 18:41:02
This question already has an answer here: Smallest data URI image possible for a transparent image 9 answers I've built an image slider (based on the terrific bxSlider ) which will preload images just-in-time before they slide into view. It's working pretty well already, but I don't think my solution is valid HTML. My technique is as follows: I generate the slider markup with the first slide image being inserted as usual (with an <img src="foo.jpg"> ) and subsequent images being referenced in a data attribute like <img data-orig="bar.jpg"> . A Javascript then juggles the data-orig -> src

Event listener for current and future elements Without jQuery

流过昼夜 提交于 2019-11-29 14:53:27
问题 If I remember correctly, I once saw a method to bind event listeners to every single element that matches a certain criteria, a query selector maybe. Looking for it again I cannot find anything other than people highly dependent on jQuery but I prefer a real simple way to achieve this. Anyone knows what is this method called? 回答1: The method you are looking for is called event capturing . You can do it like this: document.querySelector('body').addEventListener('click', function(evt) { // Do

How important is it to follow web standards? [closed]

不羁的心 提交于 2019-11-29 11:21:13
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I recently found out that most of the major websites fail W3C's markup and CSS validation tests. Therefore, how important is it really

Multiple Forms With Input Fields With The Same Name Attribute? Good Or Bad?

邮差的信 提交于 2019-11-29 02:55:37
Is it an acceptable practice to have multiple HTML forms on a page with input fields that share the same name attribute? For example, the page contains a listing of all players and users are allowed to vote for the best player so next to each player card there is this form: <form class="vote-for-player" enctype="application/x-www-form-urlencoded" method="post" action="/index/vote-for-best-player"> <input type="hidden" name="player_id" value="1" /> <input type="submit" name="vote_for_player" value="Vote" class="input-submit" /> </form> Value attribute of the hidden input field is different for

Why <big> is not in HTML 5 Tag list while <small> is?

杀马特。学长 韩版系。学妹 提交于 2019-11-28 21:43:51
问题 Shouldn't both be removed? Or does it mean we should use <small> ? Why is <big> removed but <small> is not? What is the problem with <big> which does not apply to <small> ? http://www.w3schools.com/html5/html5_reference.asp 回答1: Remember, the tags are meant to be semantic, not presentational. There is such a thing in English as "fine print". This is what the small tag represents. There is no analogous concept of "big print" except for a header, which is already covered by seven other tags.

Correct use of Blockquote, q and cite?

痴心易碎 提交于 2019-11-28 17:10:16
Is this the correct use of Blockquote , q and cite ? <p> <blockquote>Type HTML in the textarea above, <q>and it will magically appear</q> in the frame below. </blockquote> <cite><a href="http://stackoverflow.com">refrence url</a> </p> Is use of Blockquote , q semantically correct? or both are presentational element , so should not be used? Josh Lee Yes. They are not presentational elements — blockquote represents a block quotation, q represents an inline quotation, and cite represents a reference to a name, work, standard, URL, etc. You do have some validation errors that are fairly common

Why is there no OFFICIAL JavaScript reference? [closed]

一曲冷凌霜 提交于 2019-11-28 13:57:37
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I tried to search for a JavaScript reference, but there's none available. The best two suggested sources are MDN (Mozilla Developer Network) and W3Schools. Why? 回答1: It's not like there is an official JavaScript release. All the browsers have made their own JavaScript engine - some are using the same though. But

Do browsers send “\\r\\n” or “\\n” or does it depend on the browser?

…衆ロ難τιáo~ 提交于 2019-11-28 04:36:19
This question has bothered me for a million years... whenever I create a website with a textarea that allows multi-line (such as a "Bio" for a user's profile) I always end up writing the following paranoid code: // C# code sample... bio = bio.Replace("\r\n", "\n").Replace("\r", "\n"); bio = Regex.Replace(@"\n{2,}", "\n\n"); So, what do browsers send up for a <textarea name="Bio"></textarea> if it has multiple lines? The HTTP and MIME specs specify that header lines must end with \r\n, but they aren't clear (some would argue that it isn't clear if they are clear) about what to do with the

Shouldn't we use <noscript> element?

。_饼干妹妹 提交于 2019-11-28 02:50:52
I found some good cons here: The noscript element only detects whether the browser has JavaScript enabled or not. If JavaScript is disabled in the Firewall rather than in the browser then the JavaScript will not run and the content of the noscript element will not be displayed. Many scripts are dependent on a specific feature or features of the language being supported in order for them to be able to run (for example document.getElementById). Where the required features are not supported the JavaScript is unable to run but since JavaScript itself is supported the noscript content will not be

How can HTML5 “replace” Flash? [closed]

走远了吗. 提交于 2019-11-28 02:41:32
A topic of debate that's seen a resurgence since the unveiling of the iPad is the issue of Flash versus HTML5. There are those that suggest that HTML5 will one day supplant/replace Adobe Flash. I do not develop software that runs in a browser, so my (limited) understanding is: HTML is a pure-text markup language that is delivered over HTTP to a client browser. The client browser interprets the markup and renders (with varying degrees of success) the page according to an standard specification. Adobe Flash is a propriety framework for working with audio, video, sound and raster/vector graphics.