cross-browser

restore overridden window.JSON object

寵の児 提交于 2019-12-01 16:44:57
Some code that I don't have control over is overriding the global JSON object without checking if it's already implemented: var JSON = { org: "http://www.JSON.org", copyright: "(c)2005 JSON.org", license: "http://www.crockford.com/JSON/license.html", stringify: function(a, g) { ... The problem is that this version of the JSON parser is very old and has a bug, which is fouling up my attempts at serialization. (Others have had a similar problem with this implementation.) Can I get at the browser's native implementation? I thought delete would work , but it doesn't. I suspect that's because JSON

CSS - border-radius doesn't display in IE6/7/8

情到浓时终转凉″ 提交于 2019-12-01 16:43:59
问题 I'm using the following CSS to achieve a rounded border on my DIV: border: 1px solid #999; border-radius: 6px; -ms-border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px; But in IE 6/7/8, even though I'm including the IE specific radius, it is not displaying a rounded DIV border (it's displays a square border). Any ideas why only IE 6/7/8 doesn't display a rounded border? 回答1: As of IE8, IE doesn't support the CSS3 border-radius property. Not sure what you saw that said it

Is quirks mode relevant in 2011?

亡梦爱人 提交于 2019-12-01 16:42:52
With all the latest browsers like IE9, FF4, ever updating chrome, etc., do we still need quirks mode? If yes where is it useful? In which scenario? No. You should never use quirks mode. It ceased to be of any relevance once IE 5.0 and 5.5 stopped being used. Those were the last browsers which did not support standards mode, so any sites which needed to include support for them would have needed to be able to work in quirks mode. However, IE6 along with all versions of all browsers released since then supports standards mode. Some of them still carry legacy support for quirks mode, but you

What debug logging tools are available from Javascript? [closed]

*爱你&永不变心* 提交于 2019-12-01 15:59:20
I'd like to create a "universal" debug logging function that inspects the JS namespace for well-known logging libraries. For example, currently it supports Firebug's console.log: var console = window['console']; if (console && console.log) { console.log(message); } Obviously, this only works in Firefox if Firebug is installed/enabled (it'll also work on other browsers with Firebug Lite ). Basically, I will be providing a JS library which I don't know what environment it will be pulled into, and I'd like to be able to figure out if there is a way to report debug output to the user. So, perhaps

restore overridden window.JSON object

吃可爱长大的小学妹 提交于 2019-12-01 15:50:25
问题 Some code that I don't have control over is overriding the global JSON object without checking if it's already implemented: var JSON = { org: "http://www.JSON.org", copyright: "(c)2005 JSON.org", license: "http://www.crockford.com/JSON/license.html", stringify: function(a, g) { ... The problem is that this version of the JSON parser is very old and has a bug, which is fouling up my attempts at serialization. (Others have had a similar problem with this implementation.) Can I get at the

Using conditional knockout templates with IE8

≯℡__Kan透↙ 提交于 2019-12-01 15:12:02
In all 'modern' browsers the following works but not in IE8: <!-- ko template: {if: $root.itemToEdit.SomeObject() === $data, name: 'EditItemTemplate', afterRender: $root.initializeEditPanel } --> <!-- /ko --> I get the following error: SCRIPT5022: Unable to parse bindings. Message: SyntaxError: Expected identifier, string or number; Bindings value: template: {if: $root.itemToEdit.SomeObject() === $data, name: 'EditItemTemplate', afterRender: $root.initializeEditPanel } It seems to be the inclusion of the if statement inside the template definition. If I change the markup to the following, IE8

Making text unselectable [duplicate]

旧城冷巷雨未停 提交于 2019-12-01 15:09:12
This question already has an answer here: How to disable text selection highlighting 42 answers So, while playing with scrollbars and stuff in HTML5, I'm starting to notice an annoying trend. If I have text near my element that's being dragged (say, a scrub bar for a video, scroll bar, anything a user would click and drag), nearby text will get selected, as if I'm not using a control, just dragging over the page. This is terribly annoying, and I can't seem to find the right string to search for on google to figure out if it's possible to make certain elements "unselectable". Anyone know how to

How do I make text-shadow and box-shadow use the text color on all browsers?

﹥>﹥吖頭↗ 提交于 2019-12-01 14:57:05
问题 I'm trying to create a style for a box with a shadow that's the same color as its text. Because I have several boxes, each with a different text color, I'd like to avoid having to repeat the same color in each individual ruleset for every box. Now, the Backgrounds and Borders module states, for box-shadow (which also applies to text-shadow): Where <shadow> = inset? && [ <length>{2,4} && <color>? ] The components of each <shadow> are interpreted as follows: ... The color is the color of the

What debug logging tools are available from Javascript? [closed]

本秂侑毒 提交于 2019-12-01 14:52:08
问题 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'd like to create a "universal" debug logging function that inspects the JS namespace for well-known logging libraries. For example,

Making text unselectable [duplicate]

别说谁变了你拦得住时间么 提交于 2019-12-01 14:46:52
问题 This question already has answers here : How to disable text selection highlighting (43 answers) Closed 2 years ago . So, while playing with scrollbars and stuff in HTML5, I'm starting to notice an annoying trend. If I have text near my element that's being dragged (say, a scrub bar for a video, scroll bar, anything a user would click and drag), nearby text will get selected, as if I'm not using a control, just dragging over the page. This is terribly annoying, and I can't seem to find the