Tagged Questions
2
votes
1answer
197 views
Refactoring this state machine (upvoting/downvoting)
I have a list of resources which can be voted on.
There are 3 voting states: upvoted, downvoted and no vote.
In a fashion identical to stackexchange voting, it follows these rules:
If you upvote a ...
3
votes
1answer
2k views
How can I shorten my jQuery for Show/Hide Function with Multiple Div IDs?
I've created a sliding panel menu that works (JSFiddle: http://jsfiddle.net/stephmoreland/3BT7t/), but I can't wrap my head around shortening the jQuery for it. Right now, when you click one of the ...
1
vote
2answers
683 views
calling functions over and over?! improvements needed
Not some much a problem, I am curious to know if my code can be cleaned up here a little. One annoyance is im calling a function three ( 3 ) times. I would like to know how this could be improved, ie: ...
2
votes
2answers
641 views
Setting variables inside an if else if statment and improving my javascript/jquery code
I refactored/rewrote my code to produce what is below and I am trying to work out if there is a more efficient way of doing it i.e. less lines of code and quicker etc.
I am also wondering if it is a ...
4
votes
2answers
843 views
Do I always have to return something in an anonymous function?
I have inherited this snippet of jQuery JavaScript and am currently brushing up on my jQuery. NetBeans IDE complains that Anonymous function does not always return a value. So there is not always an ...