7
votes
1answer
576 views

JavaScript Boilerplate - Review comments required

I am in between to create JavaScript Boilerplate (collection of best practices around) for low/medium complex project and will host on GitHub in sometime once finalized it. Have divided the ...
3
votes
1answer
76 views

Challenge: solution for this deep-iteration JavaScript function dilemma?

Trying to implement a deep-iteration function with some constraints, I've noticed the faster solution is iterating it twice! Any attempt to avoid this resulted in slower code. So, the challenge: can ...
3
votes
2answers
415 views

How to add forms dynamically in javascript?

Example speaks for it self: function writeSpecialTabContentForTtm(){ document.write('<div style="float:right;width:250px;min-height:200px;display:block;border-width: 1px 1px 1px">'); ...
3
votes
2answers
442 views

How are my javascript module pattern and promise pattern?

I'm working on an app that downloads some SVG paths from a server and draws them. Anything in here is open to critique, but specifically I'd like to review my use of a module pattern and my ...
3
votes
1answer
186 views

Is there a way to simplify this pattern

I'm using the following pattern in my mobile app. The code snippet below manages stopwatch. Is there a way to simplify the code for better readability and probably getting away from needing to use ...
2
votes
2answers
108 views

JavaScript event handlers, scope, and the module design pattern

I've been using JavaScript for some time now, but mostly just jQuery to prettify web pages. I've started doing some serious development with it in the last year. So, I want to make sure I'm not ...
2
votes
3answers
220 views

What pattern do I use to refactor a lof of if/else statements

I have a set of if/else statements that trigger certain actions. As a first step, I was thinking about moving the logic in each if statement to be its own function, but any recommendations on what ...
2
votes
2answers
640 views

JavaScript MVC - review and suggestions

Before I start working on a quite JavaScript heavy application I would like you to review my JS MVC approach. How can it be improved? Are there any mistakes/issues I should be aware of? Since the ...
2
votes
1answer
58 views

Request for Review: genContent Plugin

WHAT: Plugin for inserting content WHY: Fallback for CSS generated content for IE Please review and suggest optimization tips and or improvement of code. See the TODO in code and offer advice. ...
2
votes
0answers
572 views

Component based system for javascript game

Hi I'm creating a javascript/webgl based game and would like you guys to take a look at the current entity component system which I created for it. I've used it once before on another project, and ...
1
vote
3answers
84 views

Improving Javascript code of a failed test

I just failed in a JavaScript test and I would really appreciate some comments of how I can improve so I can keep learning. The test was about making a form interactive, where the code should do ...
1
vote
2answers
56 views

Reduce JavaScript code. Double event, selector into one

Any idea how to write this code better."the html is nested tabs" Two selectors and two similar events, in a function would be better or a pattern to reduce lines. eg .jsbin $(function() { var ...
1
vote
1answer
66 views

Pattern for creating a JavaScript plugin

I 'm currently using this pattern to create and extend a globally accessible custom plugin to be used in a web application: ; // defensive programming: script may be concatenated with others ...
1
vote
1answer
868 views

How to re register dynamic scripts registered with ClientScriptManager in asp dot net using session was bad idea

Following the normal pattern of adding inline scripts to gridview row/s is a bad practice it used to work like below protected void CustomersGrid_RowDataBound(object sender, GridViewRowEventArgs e) ...
1
vote
0answers
216 views

Could this JavaScript / PhoneGap code be improved to use module, or other, pattern for better readability and maintainbility?

I have a PhoneGap application that I wrote some time ago. After looking Doug Crockford's video seminar JavaScript: The Good Parts (http://www.youtube.com/watch?v=hQVTIJBZook) I was just wondering if ...

1 2
15 30 50 per page