All Questions
9,398 questions
6
votes
1
answer
10k
views
Getting JSON with jQuery and creating lists with click events calling more jQuery and JSON
I have two elements on my page:
<ul id="VerticalMenu></ul>
<ul id="AccordionMenu"></ul>
I'm calling some JSON with jQuery and loading ...
4
votes
1
answer
1k
views
Ext JS: Avoid duplication
I have ext_scaffold (question.js). When I row click I get answers on this question, so
...
3
votes
1
answer
528
views
Ordering cell rows and columns
How can I make this sort faster and better?
...
10
votes
3
answers
6k
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 ...
9
votes
3
answers
970
views
Canvas Drawing/Animation
I am trying to learn how to write good, clean, and efficient JavaScript. I consider myself a novice, at best, in JavaScript. Any comments are appreciated.
In an effort to become a better JavaScript ...
4
votes
2
answers
471
views
The first major app CMS writen
I am looking for a suggestion or advises about some code I have written. I build an online application about 3 month ago the app registers new buildings including description names and so on. The app ...
7
votes
1
answer
2k
views
jQuery password confirmation
I have built a "reset and confirm password" section on a site. It works great. I just have this suspicion that maybe it isn't the most efficient way. I am relatively new to
jQuery but I can usually ...
39
votes
5
answers
7k
views
JavaScript binary search
I wrote an implementation of binary search in JavaScript earlier for kicks, but I noticed my version was significantly different than those found on Google. Here is an example of binary search I found ...
12
votes
3
answers
4k
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 ...
8
votes
1
answer
18k
views
JQuery UI Datepicker with beforeShowDay function
I am relatively new to JavaScript and JQuery. I wanted a Datepicker that has the following functionality:
Weekends are not selectable
Non working days (bank holidays etc.) are not selectable
The ...
5
votes
2
answers
3k
views
jQuery plugin to create sticky headers
I've written a plugin that takes a generic approach to creating sticky headers and would like to have the code reviewed. Is this acceptable JavaScript?
Demo Page
It's my first plugin however and I'...
8
votes
1
answer
2k
views
Review on my multiple JQuery Slider on a page
I have successfully placed multiple jquery ui slider on a page and its transalation text too. you can check it live on:
http://outsourcingnepal.com/projects/jQuery%20slider/
I have my jquery code as :...
6
votes
2
answers
419
views
Window-scrolling controller
I generally feel that the pattern I use for development is kind of wrong. I start with simple functionality, then when I realize that some pieces can be reused I usually start to write "scope root ...
2
votes
5
answers
2k
views
How bad is this jQuery? [closed]
$($(this).parent().parent().parent().parent().parent().parent().children()[0]).html()
5
votes
3
answers
294
views
Cycling between element above and below current array element
The title sucks, but it's really very simple - given an array and a starting element, cycle between one element above, below, then two element above, and below the starting element. For example:
<...
9
votes
2
answers
6k
views
Animations with vanilla JS
I've used jQuery for a long time, and now I'm going to do some animations with vanilla JS. Here's my code so far:
...
16
votes
3
answers
791
views
Displaying RSS feeds from Google Feed API as HTML list
What it does is:
Reads from a RSS feed using Google Feed API
Shows the list in an unordered list
How good/bad is the code snippet?
...
9
votes
3
answers
489
views
Demo of advertisment website
A fully functional demo URL: http://69.24.73.172/demos/index.html
Note that in FireFox there is a small horizontal scrollbar bug which I have fixed at home.
HTML:
...
10
votes
2
answers
200
views
Separating and organising modules with objects?
As I'm creating a 3D Tic-Tac-Toe game, I'm having several modules inside my JavaScript application. For example, there is a 3D module which handles perspective calculations, whereas a Multiplayer ...
7
votes
2
answers
297
views
JavaScript portion of regexp tester
I'm quite new to JavaScript, and I'd like a review of the code structure and syntax. It serves this little online regexp test (still a work in progress).
The whole code (JavaScript, CSS & HTML) ...
8
votes
1
answer
238
views
Generating readable text in a human language from machine-readable data
I have been generating English-language text from some machine-readable data, but now I want internationalization of my script to be relatively easy. The challenge is that some data might be missing ...
8
votes
1
answer
631
views
Processing an API's JSON response
I am using the JSON output of the MediaWiki API documented here and here, and I have found that for Boolean values, it often returns an empty string if true and omits it if false. Thus, I want to "...
6
votes
1
answer
550
views
Creating a tab plugin
I am creating a tab plugin. I want to know if there is a better way of doing this or if what I have is good. It works just fine, but there may be some shortcuts or a more optimized way of ...
9
votes
3
answers
2k
views
Is there a better way to output a javascript array from ASP.net?
I often run into the problem of producing a javascript array on an ASP.net page from an IEnumerable and I was wondering if there was an easier or clearer way to do it than
...
11
votes
1
answer
686
views
String interpolation library
I was bored over the last couple of days and wrote up a string interpolation library for JavaScript.
I'm very pleased with its functionality, it passes it 79 tests cross browser and the comments and ...
20
votes
1
answer
484
views
Unit-testing function
I've got this javascript function which was written a bit ad-hoc and I'm not really sure how to go about refactoring and improving it.
It's basically an implementation of draft Unit-Testing/1.1 ...
14
votes
2
answers
2k
views
Clickable icon for expanding/collapsing content
The general idea of the code is that I have a + or - icon (".trigger") that is click-able ...
8
votes
1
answer
3k
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
1
answer
988
views
Branch-and-bound based IP solver
I've written this rather naïve branch-and-bound based IP solver.
Are there any obvious JavaScript optimisations that could speed it up? I am not looking for asymptotically better algorithms, just ...
2
votes
1
answer
305
views
Do I need to use a callback function here, or is there another way?
Here is the pertinent code:
index.html
...
6
votes
2
answers
626
views
Basic form validation
Question + Desired Outcome
The code below works currently, however I'm not convinced the utilisation of an Array to iterate through numerous non-existent form ...
6
votes
2
answers
3k
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 ...
8
votes
2
answers
331
views
Theme/skin swap... version 2! (CSS-driven)
I basically have an AJAX-fetched skin (html/css) that's loaded into a dummy element (id=SkinContainer) when the page is loaded, and then the content of one of its divs (contentdiv) is fetched with ...
4
votes
2
answers
729
views
Making sure all elements are processed in a JQuery call
I have a piece code similar to below:
But I keep having this nagging feeling that there has to be an easier way!
Any ideas?
...
8
votes
3
answers
478
views
Basic JavaScript library
My own CMS is currently using jQuery, but as one of the goals is to have the whole project to be very small, I've decided to write my own basic library. I only really need to select elements and ...
22
votes
1
answer
1k
views
Dynamically generating a list of events
This is a simple list of items in a list, which allows the user to dynamically generate that list of events. Then a controller action does the work of serializing that into the database.
The issue is ...
24
votes
3
answers
13k
views
Usage of the ternary "?:" operator with functions listening to click events
I've recently been doing some mods to some old code I've been maintaining for a couple of years now.
As part of a wider set of scripts using YAHOO YUI 2.2 (yes, that old) for dialog-style panels, I ...
6
votes
2
answers
438
views
Need a feedback on my Javascript code and app implementation idea
I'm new into Javascript, and I'm not sure that is a good approach. The code works, and does what I need it to do but I'm sure I didn't do the things the right way.
Can you give me feedback about the ...
14
votes
2
answers
3k
views
Simple star rating system
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 ...
4
votes
1
answer
723
views
Skin/theme swap
Theme-swap functionality will be done via a better-looking <div> at the top of the page, but for right now, it's just thrown on the button. The theme ...
6
votes
3
answers
508
views
Javascript Object Placement / String Parsing Method
This JS function is intended to retrieve or place a value into an object with the nested keys as a string.
For example
...
7
votes
1
answer
716
views
Build menu from MS Word XML
I've recently assembled some jQuery that allows a user to build out a bulleted list in MS Word with hyperlinks and turn that into a HTML unordered list. Ideas for uses are website menu systems where ...
13
votes
1
answer
2k
views
ExtJS Grid Plugin
The code below is a plugin I wrote for Ext.grid.GridPanel, which basically allows you to have a bit more control over how rows are striped in the grid. By default ...
17
votes
3
answers
1k
views
Using a navigation menu to help keep material organized
I'm 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 ...
18
votes
2
answers
802
views
Cleaning up class creation / extension
I was wondering for quite some time how to clean up the below code without blowing it up any further. The extension of the classes is the main concern here, it looks a bit too much like magic. That's ...
8
votes
2
answers
502
views
Pagination plugin
This plugin is written in jQuery and is made to support the codeigniter framework. It is an ajax powered table pagination plugin designed to provide only that. You should be able to use almost any ...
31
votes
1
answer
464
views
Managing network address information
I'm a developer at a networking company that really has no peers that work above me that I can use for any sort of sounding board for my code, so it's just me. I was wondering if anyone would be ...
12
votes
3
answers
459
views
More elegant way to show | hide in jQuery
What is the best way to optimize this jQuery code?
...