cross-browser

Javascript works in IE but not in Chrome

泄露秘密 提交于 2019-12-11 14:56:43
问题 I'm trying to detect text, textarea and dropdown changes via javascript, so upon window unload, the browser will prompt that you have unsaved changes. My code works perfectly with IE but it is really unstable in Chrome. Here's my code. var ctr = 1; var isFirstLoad = true; function propertyChangedByCode() { ctr = 0; propertyChanged() } function propertyChanged() { $('[id$=SaveButton]').removeAttr("disabled"); $('[id$=SaveButton]').removeAttr("class"); $('[id$=SaveButton]').addClass("btn btn

WebGL rendering with rgl 0.93.935 R package

与世无争的帅哥 提交于 2019-12-11 14:28:01
问题 The following R code generates an HTML file and opens it in the browser: library(rgl) M <- rbind( c(0,0,0), c(-1,4,0), c(4,9,0), c(6,3,0) ) quads3d(M,col='red') browseURL(paste("file://", writeWebGL(dir=file.path(tempdir(), "webGL"), width=500), sep="")) The rendering is an interactive planar polyhedron in the 3D space. With the latest version of the rgl package ( 0.93.935 ), the HTML rendering does not work for Windows users (as well as iOS users, I think) with default configuration browser.

jQuery AJAX image upload - check browser support

妖精的绣舞 提交于 2019-12-11 14:15:12
问题 I use this plugin: canvasResize to resize images client side and upload them. This is the code: HTML <input name="photo" id="input" type="file" accept="image/*"/> JS $('input[name=photo]').change(function(e) { var file = e.target.files[0]; $.canvasResize(file, { width: 0, height: 540, crop: false, quality: 90, //rotate: 90, callback: function(data, width, height) { // IMAGE UPLOADING // ================================================= // Create a new formdata var fd = new FormData(); // Add

CSS :hover on SVG group area instead of rendered pixels, pointer-events: bounding-box not working cross browser. How to workaround

依然范特西╮ 提交于 2019-12-11 14:13:03
问题 I'm working on some animated SVGs with CSS animations that triggers on hover. I'm being able to have the SVG animate on hover the way I want to for Chrome but I'm facing a Firefox and Safari issue. Apparently, the pointer-events property applied to groups <g></g> doesn't give same behavior on this browser than on the other modern ones, at least when trying to set the value to bounding-box . I'm doing g { pointer-events: bounding-box; } but the hover only gets triggered when the actual <path>

Sticky footer is not placed at the bottom

情到浓时终转凉″ 提交于 2019-12-11 14:07:02
问题 I'm just making some quick changes to the footer. The footer needs to be sticky, i was following the method described by A List Apart method to try get the footer to stay at the bottom, but it seems to be off just a little bit. html, body { height: 100%; } #container { position: relative; min-height: 100%; } <div id="container"> <div id="content">...</div> <div id="footer">...</div> </div> 回答1: I always use the CSSStickyFooter method. HTML, a basic skeleton <div id="wrap"> <div id="main"> <

Easiest way to embed flash videos in Rails - must be cross browser compatible

不打扰是莪最后的温柔 提交于 2019-12-11 13:52:58
问题 I need to embed flv, mp4 and possibily other videos in a rails 2.3.5 application. I'm having quite a lot of problems making the videos show up in Safari 5 and Firefox 3.5. Is there an easy way to achieve a cross-browser video player and embed it in a rails app? I tried swfobject 1.5 and 2.2 with jw_player and also flowplayer but with no result. 回答1: I use in rails 2.3.5 application JW Player with rails plugin jw-playr-hlpr. It easy to use: install plugin run rake jw_player:install insert <%=

text rendering is screwed with “gradient” on IE

本小妞迷上赌 提交于 2019-12-11 13:47:45
问题 RGBA -- workaround for IE is “DXImageTransform.Microsoft.gradient".Found a handy tool provided by www.css3please.com for cross browser transparency,but applying this gradient on IE(IE8) -- works,but the text loses its clearness/legibility. applying georgia to make the font look uniform on all the browsers,but the text does not appear properly after i apply gradient . Here's the JSFiddle http://jsfiddle.net/mvivekc/GJaDy the code is-- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional/

javascript - detect print (not print preview) event

試著忘記壹切 提交于 2019-12-11 13:40:12
问题 I have a custom print preview page that shows up when a user wants to print a page. After this page, the user is directed to the browser print preview page (where you select printer, print options, etc.). If the user actually prints the page, then I want to hide my custom print preview page. If the user cancels the print, then I want to keep the custom print preview page visible. I need to be able to determine if a user has printed a page. I read that IE has onbeforeprint and onafterprint

What is the most robust way to get the width/height of the browser window using JavaScript?

陌路散爱 提交于 2019-12-11 13:38:17
问题 I am curently using the follownig conditions, but they aren't working across browsers or at all: if (typeof (window.innerHeight) == 'number') { //Non-IE: //Perform operation using window.innerWidth/Height } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) { //IE 6+ in 'standards compliant mode' //Perform operation using document.documentElement.clientWidth/Height } else if (document.body && (document.body.clientWidth ||

What happens if a browser doesn't support gzip?

别来无恙 提交于 2019-12-11 13:31:06
问题 I'm using mod_deflate to enable gzip on a site via the .htaccess file. What happens if a browser that doesn't support gzip visits the site ? 回答1: Then the server doesn't send gzip. That's the whole point of the "Accept-Encoding:" heading from the browser, which indicates this by not having "gzip" in that header. 来源: https://stackoverflow.com/questions/37264297/what-happens-if-a-browser-doesnt-support-gzip