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 ...
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. ...
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 ...
5
votes
2answers
367 views

Webpage template review

I've been spending a long time working on this template, I'd like to know if it's CSS/HTML is good, and mainly if it is speedy to load, accessible, semantic and SEO friendly. I've tested it in IE7+, ...
5
votes
1answer
118 views

Need to pass cookie information to a child iFrame - Are there any security concerns?

I have a child iframe in my page that will load content from a different web application in a different virtual directory than the parent page. The DOM will look roughly like this: <html> ...
5
votes
2answers
836 views

Nested “Select All” checkboxes

So after answering a question about nested linked checkboxes I mentioned it at work and surprisingly it turned out to be similar to something we needed. The requirements were: a "Select all" ...
5
votes
2answers
2k views

jQuery plugin $(node).toJSON() - convert html form to JS Object

GitHub project repo I've been working on this little function to convert an HTML form into a JSON Object having the same structure of the form. Basically it is intended to be useful in those ...
4
votes
2answers
155 views

Chopsticks game using HTML and JavaScript

Is there any way to simplify this code with loops or anything? I'm a beginner at JavaScript and my code is horrible. Please don't tell me to convert to jQuery or anything. function ...
4
votes
2answers
225 views

Simplifying Code for Drop-Down-Box in JQuery and HTML

I'm trying to come up with a way to make a drop down box that is displayed through a jquery mouse hover event and with nested dropdown boxes displayed through hovering over elements of the original ...
4
votes
3answers
218 views

Trying to learn JavasCript, CSS and HTML5

I just wrote a small card game in JavaScript, CSS and HTML. This is kind of my first project that I have cared about front-end. So I got things to work, but I am sure that this is not the smartest way ...
4
votes
1answer
94 views

This blueprint has already become a mess, please suggest some restructuring

I'm particularly concerned about where I have declared the functions, can I move them around to clean up the code without breaking anything? The "conjugate" function contains a lot of stuff that has ...
4
votes
1answer
84 views

Is my PHP script/embed remover robust?

The goal of this question: Your goal here is to find a security hole in my code which allows a user to create input that contains a script doing anything they want, without that script being stopped ...
4
votes
1answer
125 views

Is there a better way to write my jQuery slider?

First question here so please be gentle. I have developed a jQuery slider and I want to implement it in WordPress (it will be a Featured posts slider). This is my slider logic: If there are 1 or 3 ...
4
votes
1answer
2k views

How to exactly work with the JSON Object and jQuery, adding info to posts

I have been working with AJAX and JSON for quite some years now, but to be honest I still do not know exactly what all the functionality are, and how to create optimized code for jQuery. So my first ...
4
votes
1answer
402 views

DIV mask implemented in JavaScript/CSS

Mask.html <html> <head> <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script> <script type="text/javascript" ...

1 2 3 4 5 6
15 30 50 per page