As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am looking for a reference card for JavaScript - for example a summary of syntax and methods parameters. Google gives me lots of choices. What is a good one?
Actually, the one I use is the first hit on a Google search - Added Bytes Cheat Sheet .
Danny Goodman's JavaScript and Browser Objects Quick Reference is quite useful.
Devguru is a very good one that I use when in doubt.
If you don't mind spending a bit of money The VisiBone products are well worth the outlay!
VisiBone Javascript
For basic stuff I recommend W3Schools. It's not great but it's an ok beginning. For advanced stuff I recommend the Mozilla documentation. For on the fly prototyping I recommend a JavaScript Shell which can allow you to test what methods are available by doing something like props(object) which shows what properties (fields, methods) an object has.
Personally, I like the O'Reilly pocket reference books for stuff like this, they are inexpensive and come in handy here and there.
But, if you are looking for something online, I usually find a lot of good basic javascript (and HTML/CSS/etc..) stuff on w3schools.
You may find a lot of JavaScript cheat sheets at TechPosters website.
This is new, but very good: Encycode JavaScript Cheat Sheet
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've worked a lot with v3 recently, and if you noticed, beside usual compression that is done on scripts (local variable renaming, white space removal, etc.), the API script is pushed forward on this, and also has classes and their methods renamed with 2 character names. Also I've noticed other 'strange' things, like the names that are exposed to the API users are stored as variables and used inside the script. In my opinion, I think there is also some sort of obfuscation intended.
Don't know if I made myself clear, or if this is some sort of compression that I didn't get right, but I think you get the point.
I'm interested if someone knows if this is something like a public utility that compresses scripts in such a way, or if someone could point out some references that might help.
Thanks.
I think that Google uses their Closure Compiler - it does much of what you describe.
Google Closure Compiler
CC is much more ambitious (and rewarding) than other tools like yui-compressor or jsmin
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I read somewhere that using prototype to extend native objects (String, Number, Array, etc.) was a bad idea. Is this true? Why or why not?
I don't think it's bad. If you have a look at Ruby on Rails, very many native objects are extended with custom functionality and it's a very good framework.
What would be bad is if you change existing methods on native objects. this could cause unforseen consequences.
There's a great discussion about this in this video from JSConf 2011 by Andrew Dupont. http://blip.tv/jsconf/jsconf2011-andrew-dupont-everything-is-permitted-extending-built-ins-5211542
Basically the points are:
Don't extend Object.prototype
Some people might like to extend things, some people don't
You need to know what you're doing
Don't use two libraries that extend things, because it can be bad
Extending prototypes to add standard functionality is almost always ok.
I would stay clear of extending/modifying behavior of native objects.
It at least makes sense when developing in a team environment.
Simply because, months later, another developer writing another independent piece of code isn't immediately going to recognize the changed behavior unless documented somewhere and made aware of it prior to starting his task.
Instead, I suggest encapsulating/"namespace"-ing all such functionality such that somebody may chose to or not to use the modified functions.
Also, native objects and their methods are thoroughly tested for wide-ranging cases. So you you'd have to be completely sure of what you're doing before modifying native functionality.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've been searching around online for a while now and I can't seem to find any particularly impressive function references for JavaScript.
Of course, QuirksMode and w3schools have good information, but they're not as complete for JavaScript as the flash component reference and jQuery API are for flash and jQuery.
So does anyone know of a good JavaScript reference with some or all of the following qualities?
Documentation on most functions/objects/packages/prototypes
Browser compatibility
examples of usage
clean layout
community comments/examples
library APIs
Yes, the Mozilla Developer Center is a much better area, it lacks the community integration, but the descriptions and organization are much better (and more accurate) than w3schools.
Mozilla has very complete docs:
https://developer.mozilla.org/en/JavaScript/Reference
DevGuru has a very complete list also
http://www.devguru.com/technologies/ecmascript/quickref/javascript_index.html
in addition if you want to see all the quirky differences that Microsoft implemented then MSDN provides a fairly complete (but not frequently updated or corrected) set of docs here:
http://msdn.microsoft.com/en-us/library/ms533054%28v=VS.85%29.aspx
For the built-in objects, the reference is in the ECMAScript spec:
http://www.ecma-international.org/publications/standards/Ecma-262.htm
For the host objects, use MDC and MSDN:
https://developer.mozilla.org/en/gecko_dom_reference
http://msdn.microsoft.com/en-us/library/ms533050(VS.85).aspx
Also, there is the Webkit DOM Reference (but it seems somewhat sloppy):
http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/WebKitDOMRef/index.html
Then again there are the web-standards defined by W3C. You can use my W3 Viewer to browse them:
http://www.w3viewer.com
(The standards of interest are in the "JavaScript" and "DOM" categories)
In my opinion, nothing beats the reference of the book JavaScript: The Definitive Guide.
The JavaScript Kit have a pretty good one: http://www.javascriptkit.com/jsref/
A little harder to digest, but perhaps more complete (but only including the core, not web-specific stuff like window or document) is the ECMAScript specification: http://www.ecmascript.org/docs.php
And then there are the Mozilla and MSDN references, for browser specific stuff. https://developer.mozilla.org/en/JavaScript/Reference, http://msdn.microsoft.com/en-us/library/d1et7k7c(VS.94).aspx
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Ive been roaming around the interwebs looking for my first open-source project to contribute to - and most cool ones seem to be one-man bands on github, which I could fork - but wouldnt quite provide the code review etc. i think i want, so i can improve my python abilities.
Web.py, flask, celery, twisted etc look interesting - so far only the latter seems like a candidate for something I could properly contribute to, but even though im a decent(ish) python programmer, I think the whole event driven thing is probably too steep a learning curve for me to be able to contribute meaningfully for a while... so i'd probably like to start elsewhere.
Any suggestions?
btw. yes, there is a duplicate question here: https://stackoverflow.com/questions/117561/what-are-good-open-source-projects-in-python-for-which-i-can-be-a-contributor - but it is two years old, I think it is fair to assume new stuff / projects will have emerged in the interim.
Thanks!
You could have a look and see if you find RCTK interesting to contribute to. I'm trying to be as pythonic as possible, it actually supports python 3 if you find that interesting, and even writing demo applications is considered very useful.
I (the head developer) currently already have two contributes whose code I review. This seems to work well.
Looking through the google summer of code proposals is a possibility -- not all the projects have been picked by students, and the organizations probably still would welcome anyone willing to work on them. Participating in gsoc is another option, of course!
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I'm looking for a free JavaScript obfuscator. Would compression be enough? What tools would you recommend? Of course, I don't need military-style obfuscation, I need a simple way to prevent kiddies from stealing my javascript by looking at the source or by using something simple such as unescape().
Thanks,
Tom
Your problem is that no matter how much you compress it or hide it, eventually the browser has to interpret it. The best you can do is renaming all variables to meaningless random vars, and removing all comments and whitespace.
A few good tools:
http://www.dev411.com/dojo/javascript_compressor/
http://javascriptcompressor.com/Default.aspx
http://developer.yahoo.com/yui/compressor/
You can use /packer/
http://dean.edwards.name/packer/
As a rule of thumb, do not use a obfuscator that uses eval since this will slow down your page, use a compressor that doesn't. This will provide obfuscation for newbies, anyone else will not be deterred by any obfuscator anyway.
Most obfuscators will create a strings representing the code in the end and then use eval, this can be undone by a simple alert statements, whats the point?
If you want simple obfuscation and excellent compression, I can recommend the YUI Compressor from Yahoo.
Check out For those looking - http://javascript-reference.info/javascript-obfuscators-review.htm - pretty good overview of JS obfuscators
I will second the recommendation for YUI Compressor as well, works very well and can compress and obfuscate, also makes recommendations on javascript coding.
I vote for Packer as well. There are online versions, Standalone Versions, and even a Console Version that I use to Automagically pack my javascripts when I build my web apps.
Try http://digua.sourceforge.net.
http://www.javascriptobfuscator.com/Default.aspx
http://ajaxian.com/archives/utility-javascript-obfuscator