HTML5 is the latest revision of the HTML standard, including many new syntactical features and several APIs that support drawing, video, audio, etc.
2
votes
1answer
74 views
Game runs very slowly - optimization
I've made my first simple game in HTML5. Unfortunately, it runs so slowly. But there are only few rectangles! On my PC, frame rate is between 20 and 25. I expected something like 60-70 but no 20! You ...
2
votes
1answer
40 views
Edit/Details form in JavaScript
I have a Edit/Details form which has 4 user related fields. On click of Save, I save the edited fields to local storage (if supported) and display the same values in the Details view.
Below is the ...
-1
votes
0answers
27 views
A markdown syntax tester [closed]
I have created a Markdown tester, built on top of PHP, Yii Framework, Twitter's Bootstrap and Markdown-Pagedown JavaScript plugin used here on Stack Exchange Network sites.
My tester is a paste-bin ...
-1
votes
0answers
16 views
Please review my code: Bootstrap + HTML5 boilerplate in ASP.NET MVC 4 [closed]
I have added Twitter Bootstrap and HTML5 Boilerplate in ASP.NET MVC 4 Project. I just want to know if there is any performance problem or misplaced code.
I have used intializr in this project, which ...
3
votes
1answer
42 views
Semantically correct markup at practice
I'm writting a mark up for:
And here is my HTML:
<div id="container">
<header>
<h1><img src="images/logo.png" alt="Jessica Priston - ...
1
vote
0answers
39 views
JQuery Drag Div Code Simplification
My code allows for the user to move a div around a container div by clicking and dragging the top, much like a window on a desktop. It does this by waiting for mousedown then mousemove, getting ...
2
votes
2answers
62 views
HTML5 semantic layout (div, article, section) and explicit identifiers
I'm writing a markup for:
And I've split it for these sections:
<header>
<div id="logo"></div>
<nav id="mainNav"></nav>
</header>
<div ...
7
votes
1answer
106 views
Semantically correct html5 markup
I'm writing the markup for Corpora - A Business Theme:
And started from the header section:
Here is my markup for it:
<header>
<div class="topHeaderPart">
<a href="#" ...
-1
votes
1answer
45 views
Trouble with jquery show and hide [closed]
I'm having a ton of trouble trying to get simple jquery functionality to work. All I want is to be able to click on a menu button and have a menu pop up and click outside of it to close it. I think ...
1
vote
2answers
57 views
Playing sound on a button click
I am new to javascript and want to make sure I am on the right track when playing a sound. Is there anything I should not be doing better or not be doing at all. Below is a simple function.
...
3
votes
4answers
25 views
Using Javascript FileWriter with minimal use of closures
I'm currently writing a WebGL HTML5 game, and large part of the game initialization involved loading assets streamed over a websocket, and saving them to disk using the FileSystem API.
As part of ...
0
votes
0answers
14 views
HTML5 section or div for outer container [migrated]
I need a container to contain all elements between the open body and closing body tag.
My question is, should this container be a section or a div. I think section would be the wisest decision as it ...
3
votes
1answer
129 views
Javascript/Canvas Game Dev (pong)
This is the first time I've written javascript in this way (previously all I've done mostly is DOM manipulation and form validation in vanilla and jquery).
I've begun working on a basic pong game. ...
0
votes
2answers
46 views
HTML5 TAG using a .main class
since in my website I have a lot of <HEADER>, <FOOTER> AND <SECTION> do you think is appropriate if i use a .main class for the main HEADER, main FOOTER AND main SECTION?
In the CSS ...
2
votes
1answer
35 views
Web App Structure & User Adjustable Settings
I'm working on my first web app and would like some feedback on the code I have completed. I asked for a similar code review a few weeks ago but I have since improved my structure and added some user ...
4
votes
3answers
110 views
HTML5 code review
I have made this HTML5 structure for a new website i am working on. I'd like to know if there is a more elegant approach to do it.
Here is the Wireframe: http://i45.tinypic.com/2qiclci.jpg
1) Is the ...
4
votes
1answer
92 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 ...
2
votes
1answer
135 views
Structuring Simple HTML5 / CSS3 / JavaScript Math Web App
I am new to web apps and I am having a difficult time structuring my apps. I put together a very simple math web app which I wish to expand on. The app has the following pages/screens:
Home screen
...
3
votes
1answer
191 views
Using Javascript to add and delete rows from an HTML 5 form
I am a Javascript beginner. Here's a fictional example which isolates the functionality mentioned in the subject line. I hope to employ this functionality as part of a larger web application in the ...
0
votes
1answer
52 views
Sectioning element choice for main content in HTML5 Bones
The new HTML5 Bones template uses the following example for the main content (I removed some parts (like ARIA, comments, aside, …) not relevant for this question):
<!-- The <section> element ...
-2
votes
2answers
90 views
How do I refactor (DRY) this code? [closed]
I was hoping somebody could help me refactor my Javascript. Due to it's length (500 or so lines) I don't want to post it here. But check it out here on pastebin to let me know how I can improve it ...
0
votes
2answers
80 views
JQuery Slide Show Simplification
I'm trying to come up with the most basic example of making a JQuery slide show where you click on the current image you're viewing and you cycle through a gallery of photos. I know its probably not ...
3
votes
1answer
121 views
JS Beginner: Lack of clarity and structure - refactoring possible? | with code example
Hello to everyone!
First of all, i have to thank everyone who contributes to this great site. It has been a source of many tipps for me while starting to code in javascript!
I've read the FAQs and ...
2
votes
1answer
56 views
Markup “YYYY-MM-DD” as input hint
I want to give users help in which format they have to enter a date. The label content is:
Date (YYYY-MM-DD)
I used the following markup:
<label>Date (<kbd><abbr ...
6
votes
1answer
136 views
Best way to construct a semantic html table
I have to do a table like this one:
+-------+-------+-------+-------+-------+-------+
| th 1 | th 2 | th 3 | th 4 |
+-------+-------+-------+-------+-------+-------+
| | ...
5
votes
2answers
142 views
Review for CSS layout code
I want to get my first CSS layout reviewed.
First of all, the related HTML code is as follows -
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
...
-1
votes
1answer
58 views
Optimizations Help [closed]
How can we improve our Yslow performance grade C to A or B.
Looking for some helpful tips on improving the code on our website at www.wirenine.com - any tips to help improve page load times would be ...
1
vote
1answer
152 views
Which of the two JavaScript snippets has a better structure?
I sat down to write a demo HTML5-ish page that lets a user to perform following operations on a canvas - draw lines, draw a filled rectangle, and reset the canvas. Each operation is represented by a ...
0
votes
2answers
122 views
Is this decent HTML5 or total garbage? [closed]
So this is my first real try with HTML5 and i'm kinda lost.
Is this an acceptable way to do it? Also, it's a mobile Wordpress theme... i decided to ipost only the final output.
Thank you.
...
1
vote
1answer
175 views
Increasing web load time (coffee script and d3.js) [closed]
I took the Bubble chart visualization from Jim Vallandingham: http://vallandingham.me/vis/gates/ and added a few other features such as: a picture over svg, a click function, option to select only ...
1
vote
2answers
142 views
Is my code,design and practices is correct
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Login and Registration</title>
<link rel="stylesheet" href="reset.css" ...
1
vote
0answers
50 views
HTML5 Geolocation check and error management
I've written this code that I've been using for a while now to check for browser geolocation services for google maps applications. I have to say that I am not very happy with it as I've had to hack ...
1
vote
0answers
35 views
CSS3 animations
I have the following code, which acts like a turntable and plays Sgt. Pepper when you load the page. This works only in Safari (I suppose I can delete the FF parts then), so I'm wondering how I can ...
2
votes
0answers
104 views
How to optimize this HTML5 animation?
I'm just learning the basics of animating with Javascript and HTML5. I'm trying to create this scrolling logos element for my site, and I'm pretty sure that my code is very inefficient. Can anyone ...
3
votes
1answer
127 views
How to improve this JavaScript implementation of a TODO manager?
I was asked to create a TODO manager using JavaScript and CSS.
I did not get a good review on the code nor specific comments on how to improve it.
My implementation:
<html>
<head>
...
3
votes
1answer
115 views
Can this Drag and Drop Script be Optimized to Perform Better?
I've just finished a week long adventure of creating an HTML5 Drag and Drop scheduler. As the prototype stands it works fine, but I'm curious if some of the code can be optimized. I mostly focused on ...
1
vote
1answer
191 views
JavaScript switch statement to make an AJAX call
I have a button group that looks like this:
The user selects one of the options and they can search for a person based on that criteria.
I wrote a switch statement that populates the URL to make ...
2
votes
1answer
1k views
Dynamically adding rows to an accessible HTML form
Given the following HTML form (fragment):
<fieldset id="timesheet-rows">
<legend>Add Entries</legend>
<div id="timesheetrow-0" class="timesheet-row">
<label ...
3
votes
2answers
220 views
HTML5: Section in Article is Untitled Section in the Outliner
Assume I have an article list, each with the following format:
Article
In the header I'm placing: the article's title, the author and the image,
the paragraph belongs to the section, in the footer ...
9
votes
2answers
622 views
Semantic HTML5 and proper use of tags
I'm trying to develop a base for a blog using some of the new tags introduced in HTML5 and I want to not only make sure I'm using them correctly, but my code is also semantic.
Here is just the ...
1
vote
1answer
133 views
Can this javascript with jquery be improved?
I recently started learning jquery and javascript and put this together for the site I work on here.
/*
* Manages the error report popups
*
* written by Tom Jenkinson
*/
...
1
vote
1answer
89 views
Is there a better way of detecting when the contents of a web page changes in js?
This is the code I'm using at the moment
/*
* Adjust content height so that it always fills browser height
*
* written by Tom Jenkinson
*/
jQuery(document).ready(function() {
...
4
votes
1answer
152 views
Is this violating the DRY principle?
I feel that I am repeating myself a lot with this HTML/PHP code. Am I right, and is there a maintainable way of reducing the amount of repetition in the code?
mydomain/index.php:
<!DOCTYPE ...
1
vote
2answers
478 views
Markers on Google Maps
I am newbie at JavaScript, I am using PHP to get data from a MySQL database, and use the data to drop multiple markers into google map. Please give me some suggestion to my code, really appreciate for ...
2
votes
2answers
257 views
Javascript Getters and Setters for localStorage
i have written the following get/set for a username which is stored in local Storage. Do you think this "buys" me anything or even perhaps has major disadvantages? I have never liked relying on ...
-1
votes
1answer
93 views
Javascript, providing arguement alternatives
Is this bad coding? Is it OK to use 'OR' to specify argument alternatives?
// This function will throw an error if it has no arguements and local stroage is not available
var ...
2
votes
3answers
394 views
Can I get some constructive criticism on my HTML5 / Javascript pong game?
I am nearly done developing my pong game (made in HTML5 / Javascript), and I would like some constructive criticism on my code.
Please note that this is the first major coding project I have ever ...
2
votes
2answers
240 views
HTML5. Can I improve this? Are the semantics correct?
</header>
<!--content start-->
<div role="main">
<div id="slider">
<ul id="sliderContent">
<li class="sliderData">
<header>
...
3
votes
1answer
231 views
Better JavaScript code structure and html5 drap and drop?
This little script makes list items selectable and draggable. I'm pretty new to programming in general, and even more so to Javascript. Most of my background is in PHP and some C++. On the large, I ...
3
votes
1answer
235 views
Can my code be optimized more?
Preview: http://sparksonrails.pennfolio.com/
Jquery:
function introIconFirst()
{
$('h2.ribbon').css(
{
'marginTop': '+30px',
'opacity': '0'
}).animate(
{
...