cross-browser

Google Analytics Event Tracking not firing for multiple accounts on Chrome ONLY

送分小仙女□ 提交于 2019-12-10 10:19:31
问题 I have an issue with Google Analytics Event Tracking that is only apparent on Chrome and no other browser. I have the following Google Analytics Tracking Code firing on my site for a click on an anchor link: _gaq.push(['_trackEvent', 'Basket Remove', product_name, product_code, product_price, false]); _gaq.push(['rollup._trackEvent', 'Basket Remove', product_name, product_code, product_price, false]); Using a Web Proxy tool I can see that the first one is firing, but the second one is not.

How to make JS and CSS compatible with IE, Firefox, Chrome, Safari?

冷暖自知 提交于 2019-12-10 09:52:53
问题 Our company develops ERP and CRM, and so far our products support IE and Firefox. Now we want to support Chrome, Safari and even Opera. Is there any comprehensive materials that introduce browser compatibility of JS and CSS? thks! 回答1: theres the mozilla dev-center that has a great CSS- and JavaScript-reference. Every entry has information about browser compatibility. For a quick overview, you cauld also take a look at caniuse.com (CSS and JavaScript) that provides simple tabular lists for

CSS background url () not appearing in IE, works in FF/Safari

心不动则不痛 提交于 2019-12-10 09:46:09
问题 I'm debugging my website for the dreaded IE6 but I'm officially stumped. Appearance in Firefox: http://dl-client.getdropbox.com/u/5822/firefox.tiff Appearance in IE6: http://dl-client.getdropbox.com/u/5822/ie6.tiff Live site: Motolistr.com The following CSS works great in FF and Safari, but doesn't in IE6. #search_sort{ background-image:url('../images/nav/bg-form.jpg'); padding:10px; border:1px solid #d13a3b; margin-top:5px; } The following CSS DOES WORK in IE6, and it seems identical...(wtf)

jQuery fadeIn, fadeOut effects in IE

左心房为你撑大大i 提交于 2019-12-10 09:27:14
问题 The below fadeIn, fadeOut effect works fine in Firefox 3.0 but it doesn't work in IE 7 ... Whay is that and what's the trick? The idea is of course to get a "blink" effect and attract the attention of the user to a specific row in a table. function highLightErrorsAndWarnings() { $(".status-error").fadeIn(100).fadeOut(300).fadeIn(300).fadeOut(300).fadeIn(300).fadeOut(300).fadeIn(300); $(".status-warning").fadeIn(100).fadeOut(300).fadeIn(300).fadeOut(300).fadeIn(300).fadeOut(300).fadeIn(300); }

Copy to clipboard option for IE9, IE11 and Safari

蹲街弑〆低调 提交于 2019-12-10 07:06:06
问题 I am trying to implement a copy-to-clipboard button on a webpage. Below is the code I have written function copyToClipboard(element) { var $temp = $("<input>"); $("body").append($temp); $temp.val($(element).text()).select(); document.execCommand("copy"); $temp.remove(); } <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"> </script> <p id="p1">Text1</p> <p id="p2">Text2</p> <button onclick="copyToClipboard('#p1')">Copy Text1</button> <button onclick=

Javascript get and set availability in browsers

旧街凉风 提交于 2019-12-10 03:31:57
问题 Which browsers do not support the get and set methods for object prototypes? I believe this is a feature of ES5, an I know it works in Chrome, but I am wondering if it is safe to use for ajax apps. Here's an example: var foo = function () {}; foo.prototype = { get name () { return this._name; }, set name (n) { this._name = n || "bar"; } }; 回答1: Here's a compatibility table for you. http://kangax.github.com/es5-compat-table/ See the Getter in property initializer and Setter in property

code to detect browser back button click for any(all) browser [duplicate]

时间秒杀一切 提交于 2019-12-10 03:12:31
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Prevent Use of the Back Button (in IE) Disabling Back button on the browser How to disable Back button in IE and firefox? Penalty of times, i did not think it appropriate to post this question because it has been already asked lot of times, but this time I am posting being ready for consequences, because I have no other option. I will answer any comments, I can also show my try(in which you would be interested)

Chrome (windows) does not hide scrollbar

廉价感情. 提交于 2019-12-10 03:08:41
问题 I have this scrollable div, which (on my Mac in Chrome) hides the scrollbar when I don't scroll. On windows 8 however, it doesn't work in Chrome and Firefox. Ie doesn't support this too, but I've enabled it using the following CSS: -ms-overflow-style: -ms-autohiding-scrollbar; Is there any way to enable this behaviour for Chrome and Firefox Here is a jsfiddle 回答1: maybe you can use something like that? body { margin:0; padding:0; overflow-y: hidden; } body:hover { overflow-y: scroll; } http:/

JavaScript cross-browser: Is it safe to treat a string as array?

£可爱£侵袭症+ 提交于 2019-12-10 02:48:07
问题 Is this code safe in all major browsers? var string = '123' alert(string[1] == '2') // should alert true 回答1: No, it's not safe. Internet Explorer 7 doesn't support accessing strings by index. You have to use the charAt method to be compatibale with IE7: var string = '123'; alert(string.charAt(1) == '2'); 回答2: Everything in JavaScript is an object; arrays, functions, strings, everything. The piece of code you put up is perfectly valid, although a little confusing - there are much better ways

Strange results with an empty href and the :link pseudo class

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 02:02:04
问题 Here is some really simple markup and CSS: a { color: red; } a:link { color: green; } <a href="#">one</a> <a href="">two</a> <a href>three</a> <a>four</a> FIDDLE Now from the spec: in HTML4, the link pseudo-classes apply to A elements with an "href" attribute. So i'd expect the first 3 links to be green. But no, the result is actually that only the first link that has a non-empty href is green. So I used inspect element and I saw that the a:link selector actually overides the a selector in