cross-browser

Parsing ISO8601-like date in JavaScript: new Date() doesn't work across browsers

ぐ巨炮叔叔 提交于 2019-12-13 05:37:45
问题 How do I convert a date string coming from a database into a new Date() object? If I do the following: var x = new Date('2013-11-05 11:01:46:0'); alert(x); It works in Chrome, but in Safari it gives me the string "Invalid Date". Here's the fiddle. 回答1: The format of strings accepted by new Date(string) is implementation-dependent. If the browser correctly implements the ES5 specification, however, a strict subset of legal ISO 8601 strings should be accepted. Basically, you need to use UTC

jQuery plugin for cross browser css compatibility

孤人 提交于 2019-12-13 05:36:57
问题 In my app users will be able to change element's border style attributes like radius, color, width, style etc. Now I also need to be able to get these attributes with jQuery, however in order to get something like border-radius, you need to use css("border-top-left-radius") (at least in new versions of firefox and chrome) and this will not work in all browsers, so my question is: Is there a plugin that adds correct prefix to the css selector like webkit, moz etc. and maybe also makes these

How to change IFrame styles from IFrame itself using jquery?

走远了吗. 提交于 2019-12-13 05:32:20
问题 I have an iframe which will be inserted dynamically into the parent page ( I don't have control over this domain ) using following script... var _hf_iFrame = document.createElement("iframe"); _hf_iFrame.setAttribute("id", "_hf_iFrame"); _hf_iFrame.setAttribute("name", "_hf_iFrame"); _hf_iFrame.setAttribute("style", "height: 354px; width: 445px; border: 0; margin-left: -400px; top: 23%; position: fixed;"); document.body.appendChild(_hf_iFrame); _hf_iFrame.setAttribute("src", "http:/

How to switch between CSS rule sets, based on available parent width (not viewport width)?

感情迁移 提交于 2019-12-13 05:21:07
问题 I know that @media can be used to detect properties of the whole viewport, and then switch among CSS rule sets based on different types of media/widths, etc .. But how does one switch between CSS rules based on the width of parent div , etc ? This code preview shows the footer of my page, with some elements changed/removed: Liveweave: http://liveweave.com/JtUxpF (Switch to Split V or View mode from the top menu) On the right side of the footer, there is a small form ( marked with the red

Cross Browser Issue : document.getElementById().value not working in IE but works in Firefox

倾然丶 夕夏残阳落幕 提交于 2019-12-13 05:20:37
问题 I have 1 dropdown box[year], 2 text box [startDate, endDate] , whenever user select year from dropdown menu then text boxes startDate should auto populate to 01/01/+year and endDate to 12/31/+year . Below mentioned script works fine in Firefox but in IE getElementById('ff5').value is not working, any suggestions ? My script: <script> function autoPopulateDate(value, startDt,endDt){ document.getElementById(startDt).value='01/01/'+value; document.getElementById(endDt).value='12/31/'+value; } <

Phantom height when specifying the width of a LI using jQuery

馋奶兔 提交于 2019-12-13 05:16:27
问题 On a simple ul and li structure like this: <div id="middle"> <ul> <li> <a> bridal </a> </li> //.... </ul> </div> ul is displayed as table and li as table cell. I am using jquery to fix the width of the li, after they are loaded on the DOM. This is to stabilize the width when font family is changed. But, at chrome I get a phantom height and the the width of a is 10px+ more than the jQuery calculates. Help me fix these: http://jsfiddle.net/qK8Yr/ Note: If I remove the code to set the width, the

Is there a workaround to get proper font support in SVG loaded in an <img> tag in Chrome + Safari?

房东的猫 提交于 2019-12-13 04:20:59
问题 I'm using a data URI with my SVG markup and sticking it in the src attribute of an <img> tag. Works fine in FireFox, but in Chrome/Safari I lose the font support. See here: http://jsfiddle.net/3vhR7/ Is there a workaround for this such that I can still use <img> instead of <embed> or <object> ? EDIT: I submitted this to caniuse.com and they confirmed it as a bug 回答1: Why can't you use an object tag? It's easy and super fun. <object type="image/svg+xml" data="chart.svg"> <img src="fallback.png

Why are Google Map markers showing up on Firefox by not on Chrome, Safari and Internet Explorer

此生再无相见时 提交于 2019-12-13 04:19:20
问题 I have a bit of strange problem on this page: http://www.bluprintliving.com/locations it seems that the markers i want to display are showing up in Firefox but not showing up on Chrome/Safari or IE. I am not sure really where to start debugging this issue as there are no javascript errors. The code is in two parts. The first a js file http://www.bluprintliving.com/js/local-area-gmaps.js var localSearch = new GlocalSearch(); var global_point; var icon = new GIcon(); icon.image = "http://www

Custom Font is not displaying in IE

耗尽温柔 提交于 2019-12-13 04:13:17
问题 Here : http://thunderstorm999.byethost9.com/ Oberserve the footer text.It is not the same in IE as in the Chrome and Firefox browser.My font is not displaying as it should in IE. Also due to this the alignment in IE is not the same as it is in Firefox and Chrome.Also the layout appears a bit different in IE and in other browser.Please tell me where am I going wrong.What is the issue I am facing for IE.Please follow the link above. @font-face { font-family: 'footerFont'; src: url('UniversLTStd

Browser detect contenteditable features

喜夏-厌秋 提交于 2019-12-13 04:04:41
问题 I realise browser detection is not generally a good idea, however as each browser has a different implementation of contenteditable, I need a way to separate out my fixes for each. Specifically: gecko and webkit require a <br /> to be inserted at the end of empty paragraphs, otherwise they are automatically deleted. ie and opera treat this <br /> as an ordinary <br /> and insert a newline. I need a way to tell which browser or at least which of the implementations to use. Please could you