<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Login and Registration</title>
<link rel="stylesheet" href="reset.css" type="text/css">
<link rel="stylesheet" href="style.css" type="text/css">
<script src="http://code.jquery.com/jquery-1.8.1.js"></script>
<script>
$(function() {
var tabContainers = $('section.tabs > article');
tabContainers.hide().filter('#login').show();
$('.ultabs a').click(function () {
tabContainers.hide();
tabContainers.filter(this.hash).show();
$('.ultabs a').removeClass('selected');
$(this).addClass('selected');
return false;
});
});
function check_email() {
var email=$("#textEmail").val();
$.ajax(
{
type:"POST",
url:"register.php",
data: {
'email': email
},
success:function(msg) {
$("#checkEmail").html(msg);
}
});
return false;
}
function check_password() {
var pass=$("#textPassword").val();
$.ajax(
{
type:"POST",
url:"register.php",
data: {
'pass': pass
},
success:function(msg) {
$("#checkPassword").html(msg);
}
});
return false;
}
</script>
</head>
<body>
<div id="siteWrapper">
<header id="siteHeader">
<h1>Header</h1>
</header>
<nav id="siteNav">
<h1>Navigation</h1>
<ul class="ultabs">
<li><a href="#login">Login</a></li>
<li><a href="#register">Register</a></li>
</ul>
</nav>
<section id="siteContent" class="tabs">
<h1>Section</h1>
<article id="login">
<h1>Login</h1>
<table>
<tr>
<td class="message" colspan="2"></td>
</tr>
<tr>
<td>E-mail:</td><td><input type="email"></td>
</tr>
<tr>
<td class="message" colspan="2"></td>
</tr>
<tr>
<td>Password:</td><td><input type="password"></td>
</tr>
<tr>
<td colspan="2"><input type="button"></td>
</tr>
</table>
</article>
<article id="register">
<h1>Register</h1>
<table>
<tr>
<td class="message" colspan="2"></td>
</tr>
<tr>
<td>Name:</td><td><input type="text"></td>
</tr>
<tr>
<td id="checkEmail" class="message" colspan="2"></td>
</tr>
<tr>
<td>E-mail:</td><td><input id="textEmail" type="email" onblur="return check_email()"></td>
</tr>
<tr>
<td id="checkPassword" class="message" colspan="2"></td>
</tr>
<tr>
<td>Password:</td><td><input id="textPassword" type="password" onblur="return check_password()"></td>
</tr>
<tr>
<td class="message" colspan="2"></td>
</tr>
<tr>
<td>Re-type:</td><td><input type="password"></td>
</tr>
<tr>
<td colspan="2"><input type="button"></td>
</tr>
</table>
</article>
</section>
<footer id="siteFooter">
<h1>Footer</h1>
</footer>
</div>
</body>
</html>
Tell me more
×
Code Review Stack Exchange is a question and answer site for
peer programmer code reviews. It's 100% free, no registration required.
|
|
|||||||
|
|
Your code look great. Here are a few tips. 1)Don't use inline javascript. Especially when using jQuery. $(el).blur( handler(eventObject) ) Old Javasript:
New Javasript:
Old HTML:
New HTML:
2)Try not to mix html, javascript, and css. Save all your javascript and css in external files, then import them. Old Code:
New Code:
3)Tables should be used for displaying data, not for design. Why not to use tables for design How to use divs to make tables 4)Use $.post instead of Old Code:
New Code:
5)Use a namespace for url or other constants. Example:
|
|||||||||||
|
|
Regarding the outline of your document:
You can check the outline of your document there: http://gsnedders.html5.org/outliner/ |
|||
|
|