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
<!doctype html> | |
<html> | |
<head> | |
<title>Hello!</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
<script src="./my_stuff.js"></script> | |
</head> | |
<body> | |
<h1>Hello World!</h1> | |
<div> |
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() { | |
alert("it's working!"); | |
}); |
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() { | |
$('h3').click(function() { | |
$(this).text("ehh... Maybe tomorrow"); | |
}); | |
}); |
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() { | |
$('#new-to-do-item').keyup(function() { | |
alert("key pressed"); | |
}); | |
}); |
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() { | |
$('#new-to-do-item').keyup(function(e) { | |
alert(e.which); | |
}); | |
}); |
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() { | |
$('#new-to-do-item').keyup(function(e) { | |
if (e.which === 13) { | |
var text = $(this).val(); | |
alert(text); | |
} | |
}); | |
}); |
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() { | |
$('#new-to-do-item').keyup(function(e) { | |
if (e.which === 13) { | |
var text = $(this).val(); | |
var listItem = "<li><input type='checkbox'>" + text + "</li>" | |
$('ul').append(listItem); | |
} | |
}); | |
}); |
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
require 'open-uri' | |
print "Enter a website domain you like (without the http://): " | |
website = gets.chomp | |
begin | |
file = open("http://#{website}") | |
contents = file.read | |
unless contents.index("<h1>").nil? | |
header_start = contents.index("<h1>") + 4 |
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
p "Enter a number: " | |
num1 = gets.chomp.to_i | |
p "Enter an exponent: " | |
num2 = gets.chomp.to_i | |
def exponent(number, exp) | |
answer = number | |
if exp == 0 | |
answer = 1 |
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
p "Enter a number: " | |
num1 = gets.chomp.to_i | |
p "Enter an exponent: " | |
num2 = gets.chomp.to_i | |
def exponent(number, exp) | |
number ** exp | |
end |