Tag: web standards

Refactoring a function that uses window.open to use the DOM rather than write()

I have an application that uses window.open() to generate dynamic popups. Unfortunately, I’ve had trouble creating the content of the new windows using the standard DOM functions (createElement, appendChild), and I’ve gone to using document.write() to generate the page. Concretely, how can I go from this: function writePopup() { var popup = window.open(“”, “popup”, “height=400px, […]

What are pros and cons to use vendor-specific extesions , which are not included in W3C specifications?

I edited my question What is a vendor specific extension? A vendor specific extensions can start with a “-” (dash) or a “_” (underscore), usually followed by an abbreviation of the company or the browser project the extension is specific for, f.i. “-moz-” for Mozilla browsers, or “-webkit-” for WebKit based browsers. This vendor specific […]

What steps can be taken to produce semantic, accessible, standards-compliant client-side output with ASP.NET Webforms?

I understand that it may not be possible to decouple the client-side from the server-side code in ASP.NET Webforms. What steps can be taken to produce a website on this framework that complies to web standards? I am particularly concerned with making the site accessible with JavaScript disabled, and compliant to WCAG2 at conformance level […]

XHTML/HTML/JS syntax: When do I use &?

I am confused when I should use & and when I should use &amp;, specifically when it’s inside Javascript inside HTML. Which (or both or neither) of these two URLs should use html-encoding? <!– Example 1 –> <script type=’text/javascript’> var myUrl = “myurl.html?bob=2&mary=3”; // or is it &amp;? downloadUrl(myUrl); </script> <!– Example 2 –> <p>Click […]

Is there any movement in the standards body to support a safe way to copy to the clipboard?

It seems like a general purpose need on the web that a page can copy something to the user’s clipboard if the request is initiated by the user (not just by some script). A classic example is something like https://bitly.com/ that wants to provide you with a shortcut link on your clipboard that you can […]

Is separation of Content, presentation and behavior possible every time?

Is separation of Content, presentation and behavior possible every time ? Many time through javascript we add classes to html and we use in CSS visibility:hidden inline. Should we always invest time to keep all separate?

Should AngularJS apps be HTML5-compliant?

I’m getting acquainted with AngularJS, and I’ve noticed that it is possible to make your template code HTML5-compliant by prefixing your directives with data-. (For example, data-ng-repeat=”…” instead of ng-repeat=”…”.) My first instinct was to prefix all of my directives as such, but I’ve been wondering: Is there a compelling reason to do so? Are […]

Explanation on window.getComputedStyle and why Chrome handles it differently

Since Chrome Stable landed v.33.0.1750.117, the logic of window.getComputedStyle has changed from other browsers. Fiddle of code below: http://jsfiddle.net/HD4bD/17/ Can anyone explain what changed and what is the ‘correct’ ruling on this? Given the following: HTML <body> <div class=”normal”></div> <div class=”display-none”></div> <div class=”visibility-hidden”></div> </body> CSS .normal:before { content: “NORMAL: ” } .display-none:before { content: “DISPLAY-NONE: […]

What is the most standard and compatible way to make a whole table row into a link?

Obviously you can’t just surround the <tr> tag with an <a> tag and call it a day; this is invalid and doesn’t even work. I have seen JavaScript used, but then what happens to browsers that don’t support JavaScript? What is the best way to make an entire table row <tr> into a link? Edit: […]

JavaScript: Is it worth making variables private and defining getters/setters?

I’d like to start by saying that I understand that JavaScript is a Classless language. My background is in Java, C++, and Objective-C which are all classic OOP languages that support Classes. I’m expanding into Web Development and have been experimenting with JavaScript and learning its Patterns. Right now I’m working with the Constructor Pattern […]