cross-browser

Displaying vector graphics in a browser

谁说胖子不能爱 提交于 2019-12-09 05:04:30
问题 I need to display some interactive (attaching with DOM listeners etc. and event handling) vector graphics in web site I am working on. There is a W3C recommendation for SVG though this format is still not recognized by Internet Explorer support of which is a must (for a public website). IE handles VML though and there are even javascript libraries that do some canvas-like drawing depending on a browser (SVG vs. VML) - excanvas, GFX of Dojo Toolkit and more. That would be nice and acceptable

Server sent events and browser limits

孤人 提交于 2019-12-09 04:06:54
问题 I have a web application that listens for Server Sent Events. While I was working and testing with multiple windows open, things were not working and I banged my head for several times looking in the wrong direction: eventually, I realized that the problem was concurrent connections. However I was testing a very limited number and even if I am running the test on Apache (I know, I should use node). I then, switched browser and noticed something really interesting: apparently Chrome limits

Strange behaviour when absolute positioning an INPUT with both left and right CSS properties

人走茶凉 提交于 2019-12-09 03:11:22
问题 I'm studying the CSS formatting of an absolutely positioned <input> . I'd like it to "stretch" inside its container (which is also positioned "absolute") so that it leaves for instance 30px both left and right, and fills all the space within... I already found a sample on w3.org site, which uses both left and right to create a kind of "frameset" in CSS. I also read an article from A-List-Apart talking about this kind of technique and found several other questions here dealing similar troubles

IE doesn't support height=auto for images, what should I use?

戏子无情 提交于 2019-12-09 02:14:11
问题 I have some images with height=auto because sometimes they are different heights whereas they are always the same width. It works in every browser but I.E., is there something similar I can use? 回答1: I found that adding min-height:1px solves the issue. Not sure why, but, worked for me. 回答2: Just leave height=auto out. If it's not given it's "auto" by default... 回答3: The solution was to add the typical IE fix :( css: height:auto !important; 回答4: i've tried all the solutions posted, and the

Inconsistent behavior of display: table and display: table-cell in different browsers

孤街浪徒 提交于 2019-12-08 22:23:22
问题 When used on their own, display: table and display: table-cell behave differently in different browsers. Environment I did my testing in three different environments : Environment 1 : OS : Linux Ubuntu Desktop 14, 64-bit Browser 1 : Chrome 45.0 Browser 2 : Firefox 43.0 Environment 2 : OS : Windows 7, 64-bit Browser 1 : Chrome 48.0 Browser 2 : Firefox 44.0 Environment 3 : OS : Windows 10, 64-bit Browser 1 : Chrome 51.0 Browser 2 : Firefox 47.0 Case 1 - display: table & box-sizing: content-box

trying to understand click events on <select> elements

风流意气都作罢 提交于 2019-12-08 22:12:55
问题 When a click event handler is registered on a select element, I find very inconsistent behavior across browsers. I set up a jsfiddle demo. Here's what I see: Firefox 12 on OS X (10.7 Lion): Event fires when the element is clicked. The dropdown opens briefly, does not stay open. Keyboard actions don't generate click actions. Firefox 12 on Linux (Ubuntu Lucid): same Chome 19 on OS X: No mouse or keyboard interaction triggers the click event. Chrome 19 on Linux: First mouse click expands options

toLocaleDateString Javascript date format issues [duplicate]

杀马特。学长 韩版系。学妹 提交于 2019-12-08 20:01:46
问题 This question already has answers here : Where can I find documentation on formatting a date in JavaScript? [closed] (35 answers) Closed 6 years ago . I've got a script and i want to format a date out to short date format ie: 7/3/2013 or 7/3/13 the first date format renders like that in Chrome but every other browser it does not - it displays the date month name and the year. function dateFormatter(date) { return date.toLocaleDateString(); } Bit confused as to why this is happening. Is it

Absolutely-positioned elements with the same z-index: which element will be on top?

老子叫甜甜 提交于 2019-12-08 18:48:34
问题 Let's say you have several images in a DIV which are absolutely positioned such that they overlap but with no z-index defined : CSS img { position: absolute; top: 0px; left: 0px; width: 100px; height: 100px; } HTML <div> <img src="..."> <img src="..."> <img src="..."> </div> I've noticed that Safari and Chrome will display the last element on top. Is this standard behavior? In other words, is it relatively safe to assume that most browsers will display the last element on top? 回答1: Yes, it's

Firefox input placeholder padding issue

三世轮回 提交于 2019-12-08 18:37:50
问题 Why Firefox not taking padding for Placeholder text. see example here http://jsfiddle.net/JfrfZ/ How to fix it? HTML <form method="get" action="/search" id="search"> <input name="q" type="text" size="40" placeholder="Search..." /> </form> CSS #search input[type="text"] { background: url(../img/search-icon.png) no-repeat 2.6% 50% #fcfcfc; background-size: 6%; border: 1px solid #d1d1d1; font: normal 1.7em Arial,Helvetica,Sans-serif; color: #bebebe; width: 33%; padding: 0.6% 2%; border-radius:

Is the behaviour of setTimeout across an OS sleep/suspend defined?

天涯浪子 提交于 2019-12-08 17:41:43
问题 I set a setTimeout for example 10s, and during that 10s, I suspend/sleep the PC. On awaken, which of the following is true:- The timeout is guaranteed to fire The timeout is guaranteed to not fire The timeout may or may not fire. It's browser-specific Same question for a recurring setInterval. Is it guaranteed to (not) continue. 回答1: Short Answer It is defined to execute in the spec. The timeout request will go into a queue of sorts and poll until it can get fired. If the system sleeps upon