Tagged Questions
5
votes
1answer
44 views
JavaScript Weather App
I am pretty new to JavaScript, and put together a weather application. I'd like to get some feedback on improvements I could make to the code itself and also possible ways to speed up weather data ...
8
votes
1answer
65 views
Calculate torque of a bolt based on grade, size, and lubricant
To calculate torque I need to look up a value from a table which I've hardcoded based on three conditions: grade, size, and thread. Then I need to multiply it by coefficients associated with the ...
10
votes
3answers
655 views
Basic timer from one minute to 0
I'm a beginner in JavaScript and I am sure that there is a better way to do it (basic one minute timer from 01:00 to 00:00 running from pageload):
JSFiddle
...
1
vote
0answers
17 views
Angular ui.route
I'm new to ui.router in Angular and have to build an app, which contains a header, sidebar (off-canvas), feedback area (save successful and warnings area) and a content area.
I thought it would be ...
5
votes
3answers
67 views
DRYing out a basic image slider
I built a very basic image slider, but I'm still having trouble refactoring.
I caught myself reusing same code for clicking the previous/next buttons, selecting a slider dot, and the automated ...
6
votes
1answer
75 views
Linear algebra, reduced row echelon form - function 1
This is a derivative post from here.
This is just a general review, so the question is the same:
Is there something...
That you would consider as a bad practice and why?
That is just bad in some ...
5
votes
1answer
83 views
Linear algebra, reduced row echelon form
The code that I am sharing here for you to review today, is a segment of a JavaScript library that I am going to write as time goes by for fun. It is only the two functions in the following code:
...
0
votes
1answer
42 views
Getting data from the server via JSON callback and parsing the data to HTML
I'm pretty new to web development with JS and was wondering if anyone can tell me how I can improve my code. I just feel like when it comes to maintainability my code would be very difficult to ...
2
votes
1answer
38 views
Basic binary Tree in JavaScript
I wrote a basic binary tree in JS. Can anyone give me some feedback about my code?
I just want to know if this is the right approach, and how I can improve the tree. I am new to JavaScript and data ...
21
votes
4answers
2k views
Snowfall in HTML
I am a beginner and I have made Snowfall in HTML for my mom. I'm pretty sure it will not look that awesome to any developer out there, but hey, that's why I've posted it.
I'd like a general review of ...
1
vote
0answers
58 views
Cleaning if / else mess in Node.js poker game
This is the third rewrite of the poker bot I am writing. The first one was such a mess of if / elses that I could not deal with ...
2
votes
0answers
141 views
jQuery animate opacity, fade, & slide up page load effect
This is the first time I've actually made my own jQuery script from scratch, because I couldn't find exactly what I was looking for. My code works how I want it to, although I don't know if I did it ...
4
votes
1answer
53 views
Simple JavaScript (sub) class [properties, getters, methods]
The more I consider object oriented JavaScript the more I am confused. There are so many different ways and concepts and I simply do not know any longer what fits best for my purposes.
I like the ...
3
votes
2answers
57 views
Method for sorting numbers
I am new to jQuery and I want to know if there is a more efficient way to achieve this.
I have an input with numbers 1, 2, 3, 4 and I want to change the order of this number dynamically according to ...
5
votes
1answer
41 views
Breaking up a navigation menu
This code works as I intended, but I am definitely a JS noob (C++ background), so I'm not sure if this is the best way to do it (for example using .each instead of ...
2
votes
0answers
78 views
Using RequireJS correctly for social plugins
I'm a beginner in JavaScript and lately I've been trying things with RequireJS, I'd like to get some feedback on how good/poor my code is and in what ways it can be improved.
My example below is just ...
1
vote
0answers
48 views
Getting the current chat room ID
I need roomId (an auto_increment primary key) to locate a specific room to update chat info. My way of doing it right now is ...
5
votes
1answer
38 views
JavaScript scrippits
I was doing writing some various things in JavaScript and ending up writing 2 scripts that proved useful in quite a lot of my other programs and I was wondering if there was anything that I could do ...
4
votes
2answers
62 views
Major code bloat reduction with jQuery
Basically I want some help in reducing the bloat of this code. I am new to JavaScript so this represents an attempt at learning jQuery by doing. All of this code works as I want it to, but it is not ...
4
votes
3answers
144 views
Is my web site structured correctly?
I'm trying to get a better handle of code organization and how HTML5 (really HTML) stack works in general. I've worked mostly with ASP.NET Webforms and done some MVC as well. Let me say now, "I hate ...
3
votes
1answer
154 views
Menu Bar Animation Plugin
I'm fairly new to JS/jQuery (a few months), and I think it's time to start getting involved in the community. So I wrote a little plugin. Nothing revolutionary. Really, the project is to write a ...
5
votes
1answer
165 views
Load JSON file into model using Javascript / jQuery (deferred, asynchronous)
As a beginner I am always determined to improve myself. I've got written the following Code using jQuery that is working fine. However, I am sure that there are cleaner ways for achieving the same.
...
1
vote
2answers
90 views
What are practical issues using this code with common JavaScript libraries?
I'm not a JavaScript programmer. I have next to no idea about "what's out there" of libraries and so on. Therefore it's not unlikely that the referred to Windows HTML Application (HTA) code here, ...
2
votes
1answer
50 views
jQuery tooltip optimization
This is my second jQuery script: a universal tooltip for my entire web page. It took me a couple of days to research and make it work.
Now, I need help from the experts to optimize my newbie code.
...
7
votes
4answers
436 views
Basic Calculator
I'm in a beginner JavaScript class and I feel like I have a pretty good grasp on all the intro material. All of my homework assignments work but they seem longer than they have to be, especially my ...
1
vote
1answer
134 views
Caesar cipher implementation
I am not very familiar with JavaScript and I'am a little confused with the object oriented peculiarities of it. I am trying to create a Caesar shift using the concepts of objects, methods and ...
10
votes
2answers
380 views
First attempt at generating prime numbers
I had to look up some other solutions online because I could not figure it out on my own, which kinda sucks. I really wish I came up with it completely on my own but that didn't happen. Nevertheless, ...
5
votes
1answer
79 views
Preloading images in JavaScript
I'm working on a little game where you press a button and a new image appears. There's a glitch every time you ask a new image to display and it occurred to me that I should preload the necessary ...
5
votes
3answers
170 views
jQuery Tab function
I have this script that I need to run a tab (jquery). Mainly I need to hide some div and add class (you sure have understood).
How should it be written in a more elegant and readable?
...
10
votes
1answer
136 views
Tabbed navigation to hide and show pages
I'm new to jQuery and trying to learn how to refactor my bloated code to make it nicer and better maintainable.
I have a tabbed navigation which I'm using jQuery to hide and show pages depending on ...
10
votes
1answer
275 views
Colorful Lights in HTML
I am a beginner and I have made Colorful Lights using check-boxes in HTML. I'm pretty sure it will look horrible to any developer out there, but hey, that's why I've posted it.
I'd like a general ...
7
votes
2answers
218 views
Pulling JSON using jQuery and manipulating the Front-end
My JavaScript is fairly new and want to learn new ways to create clean, fast code. Can you have a look at this code and guide me on how to optimise this code to improve my skills? I have provided the ...
5
votes
1answer
164 views
Active Directory details page
Recently I have been making an MVC application with a fluid, responsive design in mind. One of the views has been to implement a fast responsive active directory details page. This is how I have ...
3
votes
3answers
115 views
Login script that checks two users and their corresponding passwords
Please let me know what you think. Is the code well written? Am I using best practices (like when I chose === over ==)? Is my ...
6
votes
2answers
223 views
Data attribute text() swap on hover
This is a very basic script. If the screen width is larger than say a tablet, and a portfolio link is hovered over, it will fade out the original text and replace it with the text held in the ...
6
votes
2answers
197 views
Applying timed functions recursively
I am relatively new to JavaScript/jQuery, and cobbled together a script. Essentially, the script sets individual timers on specific DOM elements, and then recursively applies timed functions to them. ...
6
votes
2answers
81 views
Removeclass addclass multiple selectors optimization
I've written a function that works fine, but being new to jQuery, I'd like some reviews on writing this more cleanly. Anything advice would help; just trying to learn!
...
6
votes
3answers
200 views
JS validation and submission with AJAX
I've got an assignment to do pure JS validation as well as submit with AJAX. Here is the code I've got so far. I'm wondering if I can do away with the whole "reason" bit. That was because it was ...
8
votes
1answer
86 views
Download a file and update the current downloaded percentage
I am not a big fan of JS, but have been forced to use it in this situation for various reasons.
My task: Download a URL to a target file, and update another part of the application with the current ...
5
votes
1answer
78 views
What are your opinions on these small scripts?
I am new to JavaScript, and I was wondering if anyone can share their opinions on what I have done below:
First of all, the following functions are all placed in a file called main.js and that file ...
9
votes
2answers
97 views
Member list reveals member information on click (#1)
What I'm doing?
I'm creating a member-list where initially only the names are visible. Clicking the names reveals the member information. This is done with jQuery by adding/removing classes.
I left ...
3
votes
1answer
86 views
Script for generating a report in Google-Spreadsheets. Looks for various values to check and count
It all works exactly as it should. It finds data from today, finds unique emails and puts them in an array. I then check the data again from today, against the emails to total up different values. ...
6
votes
1answer
74 views
Pass in parameters instead of multiple functions
I can't quite figure out the best way to approach this. I have two jQuery objects that both are used to set cookies. I then parse the JSON and set a cookie that is either the users height or the users ...
7
votes
1answer
311 views
Find the word in a string that has the most repeated characters
The problem: I want to find the word in a string that has the most repeats of a single letter, each letter is independent. Does not need to be consecutive.
Currently I am jumping each character and ...
5
votes
1answer
87 views
Dynamic toggle system
I'm new to jQuery/JSON and I've build an dynamic toggle system. It work fine, but I'm not sure about my code and I want a better way of building this.
Could you please see my code and give ...
2
votes
1answer
181 views
Better way to check if Javascript Date object exists
When a button is pressed, an animation loop is triggered. At the start of the loop, I create a new time object.
I also have a pause button. A problem was created when paused and then started as the ...
2
votes
1answer
513 views
Drop-down menu button highlighting and hiding
I'm learning JS/jQuery at the moment and have built the following standalone script but I feel that it can probably be improved in some ways?
For example - is there a better way of switching the ...
3
votes
2answers
101 views
7 for loops, 9 variables, 7 if statements, and one function
I have a large js function to calculate the number of chips, and which denomination of chips to show as the players chip stack. It's done on the base of 10.
I have chip denominations worth 1, 10, ...
1
vote
0answers
526 views
Overriding sorter and matcher in Bootstrap Typeahead
In this code, I'm overriding the sorter and matcher for Twitter-Bootstrap's Typeahead functionality. The reason for the override is to allow state (technically Jurisdiction) abbreviations to be used ...
2
votes
1answer
66 views
Hot 18 game (modified Blackjack) in JavaScript
I've just completed my first JavaScript game. I strongly welcome any advice/opinions/insults on how crappy or good my game is.
Do you notice anything that is poorly done?
Is there anything that I ...