This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
$('#submit').click(function(e){ | |
e.preventDefault(); | |
var errors = []; | |
if(!$('#email').val().match(/^[+a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/i) ){ | |
errors.push("<li>Must be a valid email address </li>"); | |
} | |
if(!$('#password').val().match(/[0-9]+?/)){ | |
errors.push("<li>Password must have at least one numeric character (0-9)</li>"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//------------------------------------------------------------------------------------------------------------------ | |
// YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here. | |
//------------------------------------------------------------------------------------------------------------------ | |
function Animal(name, legs){ | |
this.name = name; | |
this.legs = legs; | |
} | |
Animal.prototype.identify = function(){ | |
"I am a " + this.name + " with " + this.legs + " legs"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function () { | |
$('#submit').click(function(){ | |
$.post("/rolls", function(res){ | |
$('#die').html("<img src='" + res.img + "' alt='dice'></img> "); | |
}); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Vehicle | |
def initialize(args) | |
@color = args[:color] | |
@wheels = 4 | |
end | |
def drive | |
@status = :driving | |
end | |