ECMAScript (commonly referred to as JavaScript) is primarily used for scripting web-pages but also has several embedded forms and stand-alone interpreters / JIT engines. Use this tag for questions regarding ECMAScript 5 and its dialects / implementations: JavaScript, JScript, etc., excluding ...
0
votes
0answers
15 views
Familiar with dynamic languages, new to JavaScript: criticize my style
Preamble
I am trying to learn JavaScript by writing code and looking up documentation, one problem at a time. I am already familiar with several "dynamic" languages, so I'm hoping to be productive ...
2
votes
0answers
24 views
Wrapper for jquery ajax to ensure redirects occur on clientside
Recently I had the need to make some ajax calls within a MVC 3.0 with Razor and jQuery application. After a bit of trial and error and refactoring it was discovered that a number of different needs ...
-1
votes
0answers
12 views
Function in JavaScript that outputs concat url to YUI Chart Library Output [closed]
Trying to properly write a function in JavaScript that outputs a concat'd url to Chart Library Output (for chart re-rendering)... based on selected options in dropdown list.
Problem: I am not getting ...
6
votes
2answers
145 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 ...
1
vote
1answer
35 views
Ajax plugin that binds to click and page load
I have an app that has a number ajax requests and instead of writing them all out, I created a plugin that takes options based on the request I am making.
I would like the ajax requests to occur when ...
4
votes
2answers
74 views
Ways of improving this code
I was interested in how this code can be improved apart from basic caching. Any input would be greatly appreciated. This object creates 'tokens' much like that the ios mail app and the tag section ...
1
vote
1answer
26 views
Keeping my JS decoupled but still use functionality
In the very simple code below I'm illustrating having a master 'App' object with 'Chat' & 'Posts' modules inside. Now, what I'm asking is, in my conscious effort to keep my components loosely ...
1
vote
2answers
62 views
jquery/javascript - refactoring multiple .on() events
My app has a feature that when you click the "new data" button, HTML is loaded to the page via ajax. Because I am using ajax, all events I want to add has to be bound using the on() method.
There ...
2
votes
2answers
128 views
+50
Javascript app review
So this is an app I'm working on, and I'd like to get some feedback on it. I'm leaving some key parts out, as I don't want everyone everywhere to have access to the complete code. The main pieces that ...
2
votes
1answer
21 views
Javascript - varargs constructors, method chaining, and static methods
I am wondering if the code beneath considered as the proper way to achieve the topics stated in the title of the post.
I wonder is the best practice for achieving it?
var Obj = function() {
if ...
1
vote
1answer
25 views
jquery - form data to object to html
I have a form. When I click the save button, I want to create an object from the data and pass that info to HTML elements on the same page (div.form_content).
I decided, instead of creating a ...
1
vote
1answer
44 views
jquery key up function slow -password strength indicator [closed]
Hey all, can someone tell me why this script is slow?
<div id="demo">
<input type="password" class="password text-input" id="password" value="" />
<div id="progressbar">
...
3
votes
1answer
48 views
function to generate values of a javascript object
The following code works but I am wondering if it can be improved both readability and performance.
I am using jquery and underscore.
Any suggestions, comments or feedbacks will be appreciate.
thanks.
...
2
votes
2answers
20 views
Selector targets overly obtuse - recommendations?
This presumably simple task resulted in much more scripting logic than I thought would be necessary.
Goal: when the user clicks a button inside one of the divs, it affects said div.
Issues: I did ...
1
vote
1answer
61 views
What is the simplest way to hide labels and inputs with javascript?
What is the simplest way of hiding labels and inputs in a way that they do not affect the layout. See image and the code below. The label text3 is hidden and there is no extra gap between text2 and ...