jQuery
Easy interaction
Agenda
Homework 3 Discussion
Homework 3
This is similar to homework1. Build a webpage at xxx.github.io/homework3 . The requirements:
The topic is explain one confusing statistics concept or cases observed in the media publications.
Deadline: Feb 25, 2017
Errata
I had a typo in previous slides. Please move your Homework 3 to following location: (Exercise GitHub repo rename function)
xxx.github.io/homework3
(previously xxx.github.io/homework2)
Traffic improvements and government waste
http://callingbullshit.org/case_studies/case_study_traffic_improvements.html
jQuery
Background of jQuery
Key concepts
Example 1: Make a calculator
Example 1 breakdown
Example 1 breakdown
Any codes here. This code block is executed after all HTML elements are loaded on this page. For now, just follow this common practice.
Example 1 breakdown
Example 1 breakdown
Exercise Example 1
Example 2: Toggle style
Example 2: Toggle style - Key points
Exercise Example 2
Example 3: A moving bar chart
Exercise Example 3
Example 4: Animation
Exercise Example 4
Further Readings
Let’s be cooler:
Bind your own domain name!
Purchase your domain
Configure your nameserver to point your domain to GitHub’s server (DNS)
Configure Github Pages to serve this domain
How DNS (Domain Name Server) works with GH-Pages?
More on DNS (very good animation!): https://www.verisign.com/en_US/website-presence/online/how-dns-works/index.xhtml
name.com
A: 151.101.64.133
User (Browser)
GitHub
Repo: github.com/hkbu-jour2106/hkbu-jour2106.github.io
CNAME: datavis.studio
Where is datavis.studio?
Accordingly to my A record,
please checkout 151.101.64.133
Hey, 151.101.64.133 (GitHub)
I want to visit datavis.studio
I checked the CNAME, and find that datavis.studio is binded to repo github.com/hkbu-jour2106/hkbu-jour2106.github.io . Let me serve its gh-pages to you
Homework 4
Topic (samples) for selection:
Logistics:
Tech requirements:
(next page for more notes)
Notes on Homework 4 requirement
Homework 4 is due on Mar 10 (two weeks from now). The purpose of homework 4 is to help you exercise Javascript & jQuery for basic interaction. Strongly suggest you finish it before next week (Mar 4, topic is eChart). The tech requirement is that you can use jQuery to manipulate elements: read/ write value/ content/ data; add/remove style; bind event (try something other than "click"). At the same time, you continue exercising using Bootstrap to build your web UI. The content requirement is flexible. We shortlist those calculator/ bar-chart as examples that suit your current skill-set (assuming no background before the class). If you feel comfortable with jQuery, you can try to build more complex stuff, as long as the tech requirement is fulfilled.
Common Questions
Absolute VS. Relative Paths/ Links
Relative Paths
Absolute Paths
Jump using Hash(#) anchor links
Target of the Link: Append a hash with an ID of an element to the URL
E.g. <div id="go_middle">Hello There</div>
Link to the Target: Simply append the hash #ref to the URL of your link to jump to the desired reference
E.g. <a href="#go_middle">Go Middle</a>
<a href="http://path/to/page/#go_middle">Go Middle</a> (if linking from a different page)