Tagged Questions
14
votes
2answers
2k views
Writing a better alternative to jQuery Autocomplete
Over the last months I have been writing a jQuery plugin called Better Autocomplete (Code on Github). It originated from another project, a Drupal module called Linkit, but I decided it should be a ...
10
votes
3answers
551 views
Is this code good enough? (jQuery)
I'm working on a simple star rating system, and before I move on to actually "tallying" the votes, which I figure I'll just do with $.ajax, I wanted to make sure what I've done so far has been done as ...
9
votes
3answers
402 views
How to do efficient string concatenations in JS?
I form DOM nodes as strings and append them to DOM tree like below using jquery.
var dom = '<div><div style="display: inline-block">first name</div>'
'<div ...
9
votes
3answers
3k views
Coffeescript beautification and refactoring
As much as I try, I cannot seem to get this Coffeescript code to look beautiful (I'd like to think it is possible). I have tried both Javascript and Coffeescript. Just to be clear, this code works ...
9
votes
3answers
383 views
Criticize my Javascript/Jquery game
This was a code test I was asked to complete by employer, and since they rejected me, I wonder what should I have done differently.
Here is the game live:
http://dl.dropbox.com/u/24277627/index.html
...
8
votes
3answers
672 views
My First jQuery
Believe it or not, I am 24 years old and have never written a line of jQuery... until now.
Please review my first usage of jQueryy and help me put my head into a more jQuery state. Where can the ...
8
votes
4answers
844 views
Any tips on making this JS better?
Working on a personal project to keep different snippets/examples/small projects of mine organized. I want to make the most of my page width, so I decided to write a navigation menu that slides out. ...
8
votes
3answers
558 views
How good/bad is this code?
I am sorry for the Indent style and lack of comment. But apart from that,how good/bad the code snippet is?
What it does is:
Reads from a RSS feed using google feed API
shows the list in an ...
8
votes
1answer
155 views
Simplify jQuery with .each()?
Can someone help me over this please. I have this piece of code:
$("#infocontent-northamerica").hide();
$("#infocontent-northamerica div").hide();
$('#linkwrapper-northamerica ...
7
votes
2answers
411 views
Multiple if/else statements
I'm learning programming and would appreciate any feedback on my code. I've come up with the below code. The logic works fine but the code itself seems rather confusing to me. Are there some patterns ...
7
votes
3answers
291 views
If I write spaghetti code, I'm gonna have a bad time. Help with this ajax/jquery logic please :)
This is a pretty simple script.
In short it's meant to look for an id in the data attribute in each containment div, then send an ajax call to get the amount of retweets, calculate the karma based ...
7
votes
2answers
325 views
Trying to learn idiomatic JavaScript and jQuery
I have been doing server-side development for a couple of years, but I am just now getting into doing some client-side programming. As a JavaScript exercise, I created a dead-simple jQuery image ...
7
votes
1answer
2k views
Looking for improvements on my jQuery-UI tagging widget
I am looking for any possible improvements on this tagging widget.
I ask for special attention to be paid to my blur handler in the event of a autocomplete option being specified but any ...
6
votes
4answers
930 views
Indentation and formatting for chained jQuery methods
Below I have some jQuery code that handles footnotes. My question is actually about the formatting and indentation of the code, so I won't bother trying to explain what the code does beyond that.
I'd ...
6
votes
2answers
214 views
removing jquery event handler from single element bound by delegate
I'm binding a handler to the keyup event of all input,textareas in a document
$(document).on('keyup','input,textarea',$.debounce(600, editor.handleGlobalChange));
I don't want the handler to fire ...