Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I was wondering if there was any way for me to run older versions of javascript in the web browser!
I have apps that require ECMAScript 3 that broke and I was wondering if there was anyway to run older versions without a polyfill library!
While it works fine, I want it to use ECMAScript 3 for functions like goto and such
JavaScript does not have, and has never had, goto.
and I dislike using the newer keywords.
Whatever you mean by "newer keywords", if you dislike using them, then don't use them.
Does anyone know of a way to use older ECMAScript/JavaScript versions?
Yes, use any current ES/JS version, since they are all completely backward compatible for all practical purposes.
Take a look at Babel, it's a traspiler of Js to Js, you can set the enter version and the out version and it's easy to setup.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I am confused I thought that cancelBubble is IE-only Boolean property but found it in Chrome.
From early on, the Chrome folks took the approach of trying to be broadly compatible with existing code, which in some cases meant being compatible with code written using IE-only features. Another example of this is the global event variable, an IE-specific variable set to the current event during event callbacks (so callbacks use the global rather than an argument as they do with addEventListener). Chrome has supported that since the beginning for IE-specific code that relied on it; Firefox has only recently started supporting the global event variable. Supporting cancelBubble is in that same category.
They don't support every IE-specific thing (for instance, not attachEvent), so as to avoid messing with code trying to detect IE event handling and branch. But they support a lot of IE-isms.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I've inherited a c# .net 3.5 project which I am task with converting to .net core. This is pretty much done.
However, in this project there are A LOT!!! of third party javascript libraries and I am certain there are many of them that are not being used or not needed.
Is there a way to scan the whole project to see if any of the libraries are not used?
I know this is unlikely but thought I'd ask.
Thank you
Using Chrome (but still valid with other browsers with little changes)
press F12 and click on "sources tab"
Then you can display all Resources used from your web page, images, css, scripts...
Or you can use a third party tool like this
https://marketplace.visualstudio.com/items?itemName=RobertHoffmann.FindUnusedFiles
but personally i prefrerr to do it manually not using an automatic tool.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
when I do not want to use a transpiler. I want to write straight Javascript? For example if I feature detect that let is available, so what I can not re-write my code to use block level scoping.
For example when should I start using let? Is it even possible to form a general strategy?
Feature detection doesn't really work for syntax. While you can test for syntax features using eval and try...catch, you cannot use that information to write your code one way or the other. It also doesn't really make sense to write the same code twice but with different syntax.
If you don't want to use a transpiler, you will simply have to avoid using any ES6 features until your target audience uses browsers that support it.
Is it even possible to form a general strategy?
One way would be to say that you are going to use feature X if Y% of your visitors use a browser that support it. But that also means that your site might not properly work for (100-Y)% of your visitors.
That's exactly the problem transpilers are solving...
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Everytime I think about using JavaScript (or any JS library) I see this red light in front of me. My only concern as usual is IE. So here is what I want to know:
1) Is JavaScript disabled by default in IE8 or IE9?
2) What about you, do you feel safe when including a JavaScript code in a site that may be viewed using IE 8 or 9?
3) I found so many problems when applying CSS rules to html5 tags in IE8 so I used Modernizr. However it depends on JavaScript to enable html5 tags so I could apply CSS rules to them in IE. Am I risking to lose CSS styling as well, by using Modernizr?
No JavaScript is not disabled by default in IE8/IE9
Yes I feel safe, because I code defensively with those browsers in mind if they're mentioned as requirements in the project spec.
Again, code for your requirements. If you have a real reason to believe that modernizr isn't going to cover your requirements, don't use it and style accordingly.
1) No, it is enabled by default
2) Safety is not a concern for you in that case. Nowadays, modern Javscript libraries even support IE quite well. They often implement workarounds for features not supported by IE, so that users just can't use all features the libraries has, but the scripts shouldn't crash any more.
That said, you still need to test your sites in IE.
Javascript has become a widely accepted standard finally.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Javascript : What are the different conditions when javascript work in IE but not in Firefox or some other browser?
one that i know of is that while using certain window events..
What other scenarios can cause javascript to not work properly?
The answer is too complex to fully list here. Use sites like http://caniuse.com that will tell you which JavaScript is available in which browser.
Generally speaking, all browsers implement JavaScript differently. Microsoft have long been stuck in their own world, implementing their own ways to do things, whereas everyone else seems to try and conform to the standards as much as possible. Microsoft are coming around to the "standards" way of doing things, and from what I hear, IE11 will be a massive step in this direction.
As already mentioned, you can use http://caniuse.com/ to find what you can and can't do in different browsers, but then you'll likely end up doing what many others have done...write your own API which works around these to achieve a task...which is a bit unnecessary, unless you can find a ground-breaking way to implement your API that will be beneficial to other developers.
APIs like jQuery already work around these differences. The aim with these libraries is to provide clean JavaScript, whilst being completely transparent from the underlying JavaScript implementation.
Also, look into "shim"/"polyfill" implementations. These are used when a core feature that is recognised as part of an ECMAScript version has not been implemented in the browser. These provide the implementation for you, if it is not natively supported.