Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

work i did in the first class #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion solutions/01_hello_html/hello.html
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
This is just an example! Hehe.
<!DOCTYPE html>
<html>
<head>
<title> </title>

<script src="hello.js"></script>
</head>
<body>

</body>
</html>
1 change: 1 addition & 0 deletions solutions/01_hello_html/hello.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("Hello, World!")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Semicolons aren't required in JS, but I strongly encourage you to make it a habit and always use 'em

9 changes: 9 additions & 0 deletions solutions/04_clickhandler/click.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
$(document).ready(function(){

$("div").click(function(){

var output = $(this).html();

console.log(output);
});
});
11 changes: 11 additions & 0 deletions solutions/04_clickhandler/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<script src="click.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to load jQuery before your custom script (click.js) or else click.js will try to run before the jQuery constructor ($) exists

</head>
<body>
<div>Hello</div>
<div>bye</div>
</body>
</html>
11 changes: 11 additions & 0 deletions solutions/09a_length/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title> </title>

<script src="length.js"></script>
</head>
<body>

</body>
</html>
4 changes: 4 additions & 0 deletions solutions/09a_length/length.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

var string= "This is just a string";

console.log(string.length);
14 changes: 14 additions & 0 deletions solutions/Conditionals/grade.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
var grade = 50;

if(grade <= 65){
console.log("F");
}
else if(grade <= 74 ){
console.log("C");
}
else if(grade <= 89){
console.log("B");
}
else{
console.log("A");
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff!