HTML5 is the latest revision of the HTML standard, including many new syntactical features and several APIs that support drawing, video, audio, etc.

learn more… | top users | synonyms

9
votes
2answers
133 views

Review structure of PHP/HTML

I am very new to PHP and I kind of sort of want to create the pages like I would in ASP.NET; it's just the way I am wired. I have been inserting the header/menu using a PHP Include and here is what ...
4
votes
2answers
59 views

Validating a form without using a button and changing td class

I need to validate the form inside a table and change the class of a td-element when the value is not set. I don't have a button inside a form and I can't use the jQuery validate script. I have ...
4
votes
1answer
67 views

Markup of a blog page and its posts

Currently building my personal site using Jekyll, inuitcss and GitHub Pages. I'd like to hear your thoughts on the markup of my blog page and its post pages. What do you think about handling logo's ...
4
votes
1answer
45 views

javascript for controllers of multiple audio tags

I am trying to learn to create controllers for my own HTML5 audio tags, which I often have several of on the same page. The js.jQuery code below is a simple beginning to this; it works to apply a ...
7
votes
2answers
166 views

Optimizing the performance of html5 video manipulation

I've been working on an html5 canvas video player with a lot of fun little extras and ui toys, the main one being a chroma key (green screen) effect that allows the user to key out different colors or ...
0
votes
3answers
54 views

Optimizing with microdata and address tag

Can I improve this markup? Is it SEO friendly? <div class="bloc-contenu group" itemscope itemtype="http://schema.org/Hotel" itemref="logo nom-hotel"> <p><iframe ...
2
votes
1answer
85 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 ...
4
votes
1answer
61 views

Webpage Template

Introduction I am designing a website as a hobby. As you can probably tell from the code below, I am an absolute beginner. The first thing I'd like to do is to create a nice webpage template that I ...
3
votes
1answer
67 views

Function to delete oldest items out of HTML5 localStorage. Can I make it more efficient?

In a current javascript project, I'm working with the browsers localStorage, and it will pretty consistently be full. To overcome this, I wrote a wrapper to surround the localStorage object that would ...
3
votes
1answer
118 views

Creating <select> element and append data to it

I've made the following and have a few questions: Do I have some (big) mistakes in this approach? (bad practices, 'this code is trash'...) 1.1 If I do, can you suggest what to fix? Are appended ...
5
votes
2answers
157 views

How can I improve the following code using HTML5 and CSS3?

Using the Flat Web Design Tutorial offered at 1webdesigner I tried converting the resulting PSD file to HTML5 and CSS3. While attempting to use sectioning elements in the markup I quickly found myself ...
4
votes
2answers
100 views

Is there anything incorrect about this layout, semantically or otherwise?

I would like to know if my chosen layout is HTML5 standards compliant, or if I'm using the heading tags incorrectly (or any other tag for that matter)? Main Header <h1> for website name ...
1
vote
1answer
172 views

HTML5 File API Demo

I recently wrote a small demo that allows users to send and receive files from an HTML5 Javascript application. It's all client-side. I thought this would be a good place to get feedback about what ...
1
vote
2answers
147 views

Creating Lists and Sublists Dynamically

I'm working on a simple little one page website for giving a presentation and I have some working code now, but I'm thinking there has to be a more elegant way of doing this. I would describe myself, ...
1
vote
2answers
149 views

Menu traversing on next and prev button click up and down

Can anyone optimize this code? I am new to jQuery. I want add class on next and previous button click. I wrote this code that works for me, but could anyone optimize it using jQuery predefined ...
1
vote
0answers
38 views

Need to check the check box automatically when enter anything in the textarea of html editor

i need the code when i type anything the text area of the HTML editor then the other check box automatically checked. can you help me here the sample extjs code. this.mcmServiceIndicatorsOthCheckbox ...
2
votes
1answer
119 views

Deleting a table row in JavaScript with OOP

I started learning OOP in JavaScript at school and I have to do my homework in OOP. It is a shopping list, one fills in a product and price and that is put into an array, the array its contents are ...
1
vote
1answer
95 views

WebGL ( Three.js ) simple application ( only js without html/css )

I have done the source code for my lesson, which I shall publish later in web at my website, let's look at it: <script src="three.min.js"></script> <script> var renderer, scene, ...
4
votes
2answers
151 views

JavaScript Tic-Tac-Toe review: best practices, correctness, and any other improvements/suggestions

I just finished a little game of Tic-Tac-Toe for a class I'm in, and I think it looks alright, but I'm pretty fresh, so I would like to know how I might be able to improve it, given the situation I'm ...
0
votes
0answers
163 views

Simple : Pasting plain text (without rich HTML)

I try to let users paste text without rich HTML Function should be so simple, like using clipboardData or prompt if browser not support. $('[contenteditable]').on('paste', function (e) { ...
1
vote
2answers
69 views

How can I add a delete function to this code that stores stuff in localStorage?

I'm adding names of blogs to localStorage. I use those to make links and get avatars. Here's a fiddle that does the adds but I need a nice delete function for individual entries. Here's part of ...
7
votes
1answer
179 views

First HTML5 game. - Snake!

so here's my first HTML5 game. It's a really simple snake. I've never made a game before and haven't had too much experience with JavaScript. Html <body> <canvas id="snakePlatform" ...
4
votes
1answer
43 views

“Stack exchange page visits” alike implementation

StackExchange page views works like this: Link The objective is to increment the page visits by one. User should not be able to do this by refreshing. Number of visits can be incremented only if ...
5
votes
1answer
102 views

adding a new class to html tag and writing it back with beautifulsoup

I am working on a HTML document to which I need to add certain classes to some elements. In following code I am adding class 'img-responsive'. Here is my code : def add_img_class1(img_tag): try: ...
3
votes
1answer
39 views

Optimizations for this user-account HTML structure?

I need a valid and semantic HTML structure for the user-account (user-panel) section of the overall layout of my web application. What I saw in other web apps include: User title (or email, or ...
2
votes
1answer
297 views

jQuery toggle sort order and save to variable

This is copied directly from Stackoverflow as I was suggested to post it here. I have the below code, which does work fine but I find it quite big and had hoped there was a cleaner/smaller "toggle" ...
5
votes
2answers
69 views

Am I following the correct principles for HTML / CSS coding?

I've just started learning HTML and CSS. Currently I'm creating a test site to practice with. I'm just after an early idea if the principles I'm using are correct.The below is an snipit from the main ...
1
vote
1answer
71 views

Simplifying an ajax script in my HTML

I'm using Twitter Bootstrap and I'm working on a page that has several tabs that all have carousels in them (each with a ton of images) I've managed to write an AJAX script that pulls the images from ...
6
votes
2answers
165 views

CSS code organizing

I like to keep my code organized, usually in several files. It is good for CSS. For instance: I have three files: First - layout.html, this is the main template. Second - grid.css is style sheet ...
2
votes
2answers
71 views

Having less code for the current program

I am was writing a practice program in javascript and it turned out to work quite alright, however I am not entirely happy with the code. I can't shake the feeling that there is a lot of code which ...
5
votes
2answers
190 views

Strict and clean HTML and CSS for teaching website

We are in the proces of creating a book with the purpose of teaching people the art of html and css to create a website from scratch. In our book the focal point, so to say, is that the reader is ...
1
vote
1answer
1k views

Toggle HTML elements' visbility based on selected checkbox(es)

I want to toggle button visibility based on values a user selects within a group of checkboxes. For example, the user may be given a group of checkboxes with colors: <input type="checkbox" ...
0
votes
1answer
66 views

Is the HTML5 markup right implemented and semantically correct?

I was asking if the following code has a correct semantically markup, or can it better, and so yes, how: <!-- Start container website --> <header id="header"> <div ...
3
votes
1answer
116 views

JavaScript playing different audio files based on video keyframe

the general idea of function below is to load a different sound file depending on current time position of the video. I have the following information about audio files: var samples: [ ['00:00:05', ...
1
vote
1answer
528 views

Using a single for loop to load multiple images in a canvas, better method?

I was just wondering if there's a better way to do this? If I ever have to worry about earlier images not being loaded before the later images, i.e. image[3] being loaded after image[21]. Any ...
3
votes
2answers
92 views

Replacing simple jQuery methods for better use

There are a few common jQuery call I find my self calling when creating my app. I need some help and maybe a better way to do all this or rewrite it. 1) Singleton Selector If I want to select only ...
3
votes
1answer
81 views

Collision detection accuracy

How do you guys think I can improve the code for collision detection on my website asteroidfield.eu5.org? The current code is var dx = Math.abs(c1.getcx() - c2.getcx()); var dy = Math.abs(c1.getcy() ...
2
votes
2answers
182 views

Update HTML4 to new HTML5 Semantic/Structural Elements

So im trying to update my websites code to the new HTML5 Semantic/Structural Elements, but im not very sure with the sections and article element. So here the structure of my page: <body> ...
5
votes
1answer
135 views

Do not select elements that contain data attributes

I have a selector that pulls in all anchor tags that start with the # symbol. I am trying to add a :not selector of some form for elements that have a data attribute. I know I could do the ...
2
votes
2answers
155 views

Javascript canvas interactive chart - how to make my code shorter

I'm trying to teach myself javascript and HTML5, (just beginning), and for some practice with canvas I am trying to turn this chart into an interactive chart on canvas, whereby clicking on a word ...
2
votes
1answer
90 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
98 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 ...
3
votes
1answer
75 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
265 views

JQuery Drag Div Code Simplification [closed]

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
908 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
344 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
86 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 ...
2
votes
2answers
2k 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
1k 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 ...
3
votes
1answer
645 views

JavaScript/Canvas Pong game

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. ...