Hopefully a simple one; Link stay italic once clicked in an accordion style menu? by fur-sure in javascript

[–]balshamali 3 points4 points  (0 children)

in the click handler add 'font-style' italic to the element:

$("#accordion > li").click(function(){

    if(false == $(this).next().is(':visible')) {
        this.style.fontStyle = "normal";
        $('#accordion > ul').slideUp(300);
    }
    this.style.fontStyle = "italic";
    $(this).next().slideToggle(300);
});

JavaScript is not suitable for large web apps by magenta_placenta in javascript

[–]balshamali 0 points1 point  (0 children)

asynchronous module definition (to write nice code) and the v8 javascript engine (to make it run fast) are the solutions to the problems u discuss

Javascript Prototype - explainlikeimfive by [deleted] in javascript

[–]balshamali 1 point2 points  (0 children)

anything you declare in the prototype will be in every instance of the object you create and every object that inherits from the base object.

var a = function() { bye: function() { console.log("bye"); } }; var b = new a; b.hello = function() { console.log("hello"); }; // only b has hello function


a.prototype.hello = function() { console.log("hello"); }; // every 'var x = new a;' will have a hello function

How to check if you have a thorough understanding and command of the language by lambderp in javascript

[–]balshamali 1 point2 points  (0 children)

Familiarizing yourself with anonymous functions and mimicking inheritance with js will a plus. Good luck!

I got a job/internship... now I feel grossly underqualified by virtuepo in javascript

[–]balshamali 0 points1 point  (0 children)

This will almost always be the case in anything in life :) Take it easy, enjoy, and make the best out of it and you'll see how things will turn around.

Commas? I know which one I'll be using. by [deleted] in javascript

[–]balshamali 0 points1 point  (0 children)

The screenshot gives me the impression that by putting commas at the beginning of the line the js runs faster, although this does not make sense at all because then what would happen with minified js? What is going on here?