polyfills

Angular 2 is not working on ie 9

北战南征 提交于 2019-12-13 18:31:53
问题 I've been trying to run an Angular 2 application as a template but while it works really well in Chrome and after adding polyfills it worked on IE 10 and 11 I'm struggling to get it working in IE9! I added Shims polyfills for IE. <!--[if IE]> <script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.35.3/es6-shim.js"></script> <script src="node_modules/systemjs/dist/system-polyfills.js"></script> <script src="https://npmcdn.com/angular2/es6/dev/src/testing/shims_for_IE.js"></script>

Eventsource API : EXCEPTION: No activity within 300000 milliseconds. Reconnecting

我的未来我决定 提交于 2019-12-13 04:22:54
问题 I am using eventSource API and added the addEventListener() to the eventsouce. The event source is activated till only 45 seconds. I want to keep the connection alive until the server send the response back to client. Now, I am getting the below exception because there is no response back from the server till 45 secs. EXCEPTION: No activity within 300000 milliseconds. Reconnecting. Please give me some pointers to make the connection alive/ any other approach to achieve it. 回答1: The solution

Webcomponentjs polyfill for v1 spec

老子叫甜甜 提交于 2019-12-12 01:28:33
问题 Is there a polyfill for the Web Components v1 spec available? I'm looking for a way to create components using customElements.define instead of document.registerElement . 回答1: As mentioned by @tony19, you can use v1 branch of webcomponentsjs . You can read about it here. Or you can install it using bower bower i -S webcomponentsjs#v1 回答2: If you want to polyfill only Custom Elements v1 (implementing customeElements.define ) you have the choice between 2 polyfills: document-register-element

Add a rounding method to Number.prototype in JavaScript

夙愿已清 提交于 2019-12-11 20:24:30
问题 How can I simplify rounding in JavaScript? I wish that I could do it in a more elegantly in an object-oriented manner. The method toFixed works well, but does not have backward rounding and it also returns a string and not a number. pi.toFixed(2).valueOf(); // 3.14 As it is, rounding is a bit of a tangle because I have to use: pi = Math.round(pi * 100) / 100; // 3.14 It would be much nicer instead just to stick a method to the end of a variable, such as: pi.round(2); // 3.1r 回答1: Extend

Webpack modules distribution along output files

旧城冷巷雨未停 提交于 2019-12-11 09:05:29
问题 I'm new to Webpack and Babel, but I think I've quite understood how to use them, even though, there is still one thing I haven't been able to solve. Here is the problem... Essentially, I have 3 javascript files: setup.js loader.js main.js setup.js is the only file linked to my html pages, it contains a lightweight script which dynamically inserts some needed resources, including loader.js loader.js is a bit heavier, and is responsible of downloading and inserting all the remaining resources,

Attached ShadowRoot using Polyfill is not query-able

孤者浪人 提交于 2019-12-11 07:31:47
问题 In the following sample, I am trying to create a menu component to experiment component hierarchy. index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="robots" content="index, follow"> <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>Sample Menu App</title> <script src="js/webcomponents-lite.js"></script> <!-- Components --> <link rel="import" href="components

Polymer serve changes the served javascript files for Internet Explorer 11. How to make it work on another web server?

て烟熏妆下的殇ゞ 提交于 2019-12-11 04:34:20
问题 When testing our polymer 2.01 / webcomponents 1.01 Application on Internet Explorer 11 we found out that it works fine using poyfills when serving the Application with polymer serve. It doesn't work when we are serving our application with a naked tomcat 8.x. We get Script Errors like "SCRIPT1003: Expected" with Internet Explorer. The reason for this seems to that polymer serve changes the javascript files when the Client Browser is Internet Explorer 11. For example in webcomponents-lite.js

Webcomponents Polyfill not working

北城余情 提交于 2019-12-11 04:18:57
问题 I am trying to polyfill webcomponents as explained at https://www.webcomponents.org/polyfills/ since I wanted my sample app to work on both Chrome and Firefox. However I am getting ReferenceError: customElements is not defined error in Firefox. See my code below on the index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="robots" content="index, follow"> <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no"> <meta http-equiv="x

Ionic 3 - Polyfill for ES6 in IE11 Not Working

大城市里の小女人 提交于 2019-12-11 00:26:12
问题 I am aware that Ionic have stated that they will not be supporting IE11 - however I am still currently obliged by work to try and come up with a workaround of some sort if possible! The issue I am having is the main.js file built by Ionic in the dev environment is throwing an error in IE11 due to it using template literals. I have created a polyfills.ts file which includes the following polyfills.ts import 'core-js/es6/string'; import 'core-js/fn/string/raw'; import 'core-js/es6/symbol';

read Data URL with File API polyfill

瘦欲@ 提交于 2019-12-10 19:44:07
问题 I am trying to use the File API library (https://github.com/mailru/FileAPI) as a fallback for browsers which do not support the File API, in order to read a file as a Data URL and pass that on to another function. I have this code: function handleFileSelect(event) { // If supported, use native File API. if(window.FileReader != null) { console.log('Using native File API.'); // ! var files = event.target.files; for(var i = 0, f; f = files[i]; i++) { var reader = new FileReader(); reader.onload