Interactive News Design, Week 10. Thu, Mar 27, 2014s

More Javascript and Custom Fonts


Agenda

Assignments Due before class Tuesday, April 1

Common Questions

How do I include jQuery on my page?

Paste the following code into your HTML file immediately before the </body> tag on your page:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>

How do I include my own Javascript on my page?

Put it inline in your HTML file by including an opening and closing script tag. Your Javascript goes between the <script> and </script> tags. Like with the jQuery link, your Javascript should go directly before the </body> tag in your HTML document. It should go after the jQuery code.

Here is what that looks like:

<html>
<body>
Here is some HTML
<script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
// Here is some Javascript
</script>
</body>
</html>

What is the difference between Javascript and jQuery?

Javascript is a computer programming language. It’s the scripting language that browsers use when rendering web pages, and it’s become the most popular proramming language in the world.

jQuery is a Javascript library that makes writing Javascript easier. A single line of code in jQuery might take many lines of code in Javascript. Beginners often start with jQuery, because it’s easier to understand than Javascript, but professionals use it too. More than half of the most visited one million websites use jQuery.

Why can’t I figure this out? Is this really hard?

Yes. Javascript is more complex than CSS. But you can learn it. We will spend a lot of time in class going over the basic ideas.

Where can I find an example of simple uses of jQuery?

Josh’s example is here