Take the 2-minute tour ×

My overall question is: How is someone supposed to use this language with so little information available anywhere?

I am a computer science student and just had had my first taste of JavaScript at my summer job. I arrived at a solution, but unfortunately found the experience extremely painful.

The task was to highlight selected tabs using Telerik controls in .net 4.xx .

For two days I had no idea what I was doing. No clue of what functions to call, how to access controls on the .aspx page from my script... etc. The solution I found is a mixture of a hundred Google searches, tons of Telerik examples, mixing code from lots of sources, and A LOT of luck. I learned NOTHING from this experience.

Does there not exist an API for the JavaScript language? JavaScript seems identical to Java/C/C# etc. in terms of standard programming techniques, variables etc. What bewilders me is how I can only find this same BASIC programming information regurgitated (loops, variables, if else) etc. on bad websites like w3 and nothing on the library of functions that are exposed to or available in this language.

I am tired of looking at tons of examples of other people's code to solve MY problems simply because I have no clue what functions are available to me. In Java I do not need to find examples of code because I can use the Java 7 API at an official website as a reference. It is simple, clear, and well organized. I can get creative and discover as I work my way through problems (the IDE also plays a big role). In JavaScript this does not seem possible.

To make matters worse, visual studio does not provide any information when dereferencing when coding in Javascript.

To give you a jist of what my solution was like:

var slidingZone = $find(" < % = rszDefault.ClientID % > " );

var comparePane = slidingZone.getPaneById( " < % = rspCompare.ClientID % > " );

var compareTab = comparePane.getTabContainer();

compareTab.style.background = "LightSteelBlue";

There is not a single place that had the information or functions listed in the code above. Where on earth is someone to go to quickly find something like this?

How can I learn this language? Where can I find my information easily without dredging through random posts all over the internet? Why on earth is documentation non-existant?

share|improve this question
JavaScript seems identical to Java/C/C# etc. in terms of standard programming techniques, variables etc. - best get that notion out of your head as soon as possible. It is quite inaccurate. –  Pointy Jul 24 '12 at 20:39
developer.mozilla.org/en/JavaScript also congrats for finding a solution without intellisense! How'd you do it? –  bokonic Jul 24 '12 at 20:40
I declared/utilized variables, if/else statements, and used loops the exact same way as I did in other languages. Why is half of w3's information explaining this again? –  donsiuch Jul 24 '12 at 20:41
w3schools.com/jsref/default.asp for JavaScript also is pretty good. –  Rangoric Jul 24 '12 at 20:41
@Rangoric hmm ... you might want to avoid w3schools. –  Pointy Jul 24 '12 at 20:42
show 8 more comments

closed as not constructive by squint, Servy, casperOne Jul 24 '12 at 20:53


1 Answer

I don't know where to even begin with some of your blanket statements about JavaScript and having no information online. Javascript itself is a DOM manipulation and scripting language. It doesn't have too much meat until you get into libraries like JQuery which I would advise starting to learn as soon as possible:


JavaScript has a plethora of native functions for DOM manipulation like:

document.getElementById("..."); //Gets a DOM element by it's ID value

document.getElementByTagName("...."); //Gets a DOM element by Tag

document.getElementById("...").onclick = function(){
    //Manipulate the element after a click event is fired

But keep in mind JavaScript in it's native form is severely lack luster in comparison to Java / C# for built in libraries and functionality.

You can overcome some of this complexity and browser capability issues by using a library like JQuery or you can learn the heart of JavaScript yourself. But keep in mind you have to work with the toolset you are tasked to work with in this career. JavaScript is INCREDIBLY powerful, but pretty vanilla in builtin functionality but by no means is as complex as what you're making it out to be. The issue I think you are running into is you are used to having intelli-sense write your code for you and having libraries that hold your hand and make 1 line of code do everything you want from a library someone else wrote. JavaScript without any libraries you generally have to write a considerable amount of code to do cool things, the rest is all learning curve.

Do yourself a favor and starting reading up on JQuery, it'll address a lot of what you are complaining about. As far as integration with Web Forms in legacy ASP.NET applications, this is the inner workings of .NET itself where you had to utilize <%= ctlWhatever.ClientID %>, this is something you just learn with time but is also easily found in blogs.

Part of college is to learn how to hone your Google skills ;-)

share|improve this answer
@amnotiam Well, it is primarily for DOM manipulation and it is a scripting language. The second part depends mostly on how you define "meat". –  Servy Jul 24 '12 at 20:55
@amnotiam jQuery and other libraries DO add functionality. That's like saying that C doesn't add functionality on top of assembly because all C has to work with is what ASM provides. –  Ivan Jul 24 '12 at 20:58
@amnotiam api.jquery.com/jQuery.map is a counter example to your claim. –  Ivan Jul 24 '12 at 21:05
@amnotiam - My whole point is sure, javascript is powerful enough to do anything you really wanted to do from animations to networking. But the complexity of doing so is a high barrier to entrance that is addressed by external libraries. Your argument here is counter productive and not addressing the reason I said that in the first place. Sure you CAN do everything in vanilla JS that you can achieve in JQuery... it doesn't mean you should have to. –  VulgarBinary Jul 24 '12 at 21:10
let us continue this discussion in chat –  VulgarBinary Jul 24 '12 at 21:24
show 15 more comments
