What’s the difference between disabled=”disabled” and readonly=”readonly” for HTML form input fields?

I have read a bit on this, but I can’t seem to find anything solid about how different browsers treat things. 7 s 7 A readonly element is just not editable, but gets sent when the according form submits. A disabled element isn’t editable and isn’t sent on submit. Another difference is that readonly elements … Read more

Are the PUT, DELETE, HEAD, etc methods available in most web browsers?

I’ve seen a couple questions around here like How to debug RESTful services, which mentions: Unfortunately that same browser won’t allow me to test HTTP PUT, DELETE, and to a certain degree even HTTP POST. I’ve also heard that browsers support only GET and POST, from some other sources like: http://www.packetizer.com/ws/rest.html http://www.mail-archive.com/[email protected]/msg13518.html http://www.xml.com/cs/user/view/cs_msg/1098 However, a … Read more

How to get the browser viewport dimensions?

I want to provide my visitors the ability to see images in high quality, is there any way I can detect the window size? Or better yet, the viewport size of the browser with JavaScript? See green area here: 17 s 17 Cross-browser @media (width) and @media (height) values  const vw = Math.max(document.documentElement.clientWidth || 0, … Read more

What is JavaScript’s highest integer value that a number can go to without losing precision?

Is this defined by the language? Is there a defined maximum? Is it different in different browsers? 22 s 22 JavaScript has two number types: Number and BigInt. The most frequently-used number type, Number, is a 64-bit floating point IEEE 754 number. The largest exact integral value of this type is Number.MAX_SAFE_INTEGER, which is: 253-1, … Read more

How to align checkboxes and their labels consistently cross-browsers

This is one of the minor CSS problems that plague me constantly. How do folks around Stack Overflow vertically align checkboxes and their labels consistently cross-browser? Whenever I align them correctly in Safari (usually using vertical-align: baseline on the input), they’re completely off in Firefox and IE. Fix it in Firefox, and Safari and IE … Read more

Get the size of the screen, current web page and browser window

How can I get windowWidth, windowHeight, pageWidth, pageHeight, screenWidth, screenHeight, pageX, pageY, screenX, screenY which will work in all major browsers? 20 20 You can get the size of the window or document with jQuery: // Size of browser viewport. $(window).height(); $(window).width(); // Size of HTML document (same as pageHeight/pageWidth in screenshot). $(document).height(); $(document).width(); For … Read more

How to disable text selection highlighting

For anchors that act like buttons (for example Questions, Tags, Users, etc. which are located on the top of the Stack Overflow page) or tabs, is there a CSS standard way to disable the highlighting effect if the user accidentally selects the text? I realize that this could be done with JavaScript and a little googling … Read more