Current Articles
  Archived Articles
  TECHS Articles
  Current Projects
  About Us
You are not logged in.

Please either Login or create a New Account.
Custom RSS

Note: this links is the RSS feed for the current filters shown at the top of the page. For an RSS feed for all articles in this community, click here
Tag
TECHS (9)
Link: Part 1

Hey TECHS students! Here's the second half of chapter 53: Javascript. There aren't any videos in this part as I'm wanting to clean them up and make them a bit easier. But here's the source files used as you'll see in the video on myelearning.org. These videos assume you've already been through the first half of the chapter, and are a continuation of how to use javascript in an HTML document.

There are currently three videos in the second half of this chapter:
  1. Functions   9:40
  2. Parameters   8:30
  3. Events   8:05
You may download the initial document as it appears at the beginning of the first video to get started. You may also download each document as it appears at the end of each video and test them out on your own!

For more info and training on JavaScript, visit http://www.w3schools.com/JS/. You will find plenty of easy and straight-forward examples of functionality in JavaScript, with an easy-to-find index and even a how-to page for each that allows you to test changes to their example code! If you want to read some more, start at Wikipedia's JavaScript page.

If you have any questions, drop us a comment below--we'd love to hear from you! Happy JavaScripting! :)


2.1 Functions   9:40

html document


2.2 Parameters   8:30

html document


2.3 Events   8:05

html document

Tags: JavascriptTECHS



Below are the videos for the HTML portion of the techs class. 

Segment 1 - Tools
 
Visual Studio - https://downloads.channel8.msdn.com/
Edit Plus - http://www.editplus.com/ 
Eclipse - http://www.eclipse.org/

Segment 2 - HTML intro
 


Segment 3 - Class project

Nate's Sample Project - http://www.caffeinatedcoding.org/examples/todo/todo.htm
Brian's Sample Project - http://www.caffeinatedcoding.org/examples/ilikeswitchfoot/index.html
Adam's Sample Project - http://www.caffeinatedcoding.org/examples/rockpaperscissors/index.html


Segment 4 - Headings
 

Segment 5 - Attributes
 

Segment 6 - Lists
 

Segment 7 - Breaks
 

Segment 8 - HTML Origins - Who came up with all this anyway?
 
W3C - World wide web consortium - http://www.w3.org/

Segment 9 - Links
 

Segment 10 - Images
 


There are lots more things to explore in HTML, but the previous vidoes cover the most common things. 
Tags: HTMLTECHS



Link: Part 2

Hey TECHS students! Here's the first half of chapter 53: Javascript. These videos assume you've already been through the HTML (1) and CSS (1,2,3,4) lessons, and are an introduction to using JavaScript and how to add it to an HTML document. If you've already been through this part, you may continue on to the second half of the chapter.

There are six videos in the first half of this chapter:
  1. Intorduction   4:27
  2. Changing Style   5:33
  3. Changing Content   6:11
  4. Branching   6:21
  5. Looping   7:37
  6. Comments   5:42
If you have trouble watching the videos on this page, you can also find them on youtube. After each video is a link to youtube as well as the final HTML document as shown in the video. Feel free to create the document yourself as you follow along, or download each document and test them out on your own!

You may download the initial document as it appears at the beginning of the first video to get started.

For more info and training on JavaScript, visit http://www.w3schools.com/JS/. You will find plenty of easy and straight-forward examples of functionality in JavaScript, with an easy-to-find index and even a how-to page for each that allows you to test changes to their example code! If you want to read some more, start at Wikipedia's JavaScript page.

If you have any questions, drop us a comment below--we'd love to hear from you! Happy JavaScripting! :)


Introduction   4:27   (1 of 6)


youtube link
html document


Changing Style   5:33   (2 of 6)


youtube link
html document


Changing Content   6:11   (3 of 6)


youtube link
html document


Branching   6:21   (4 of 6)


youtube link
html document


Looping   7:37   (5 of 6)


youtube link
html document


Comments   5:42   (6 of 6)


youtube link
html document

Tags: JavascriptTECHS




CSS Lesson 1 of 4: What’s CSS and Why Do We Need It?

Cascading Style Sheets (CSS) is a powerful way to add styling and to control a web site’s appearance.

CSS was created to work along side HTML, however it is a different language compared to HTML. You can use CSS to control everything from the color of your text to how far apart elements are spaced on your page. CSS will also let you change the color and background of an element as well as adding borders to an element. It will even allow you to do more advanced stuff like popup windows. One of the real benefits of CSS is it allows web designers to separate the content from the presentation and have all of a site’s presentational information in one location.

The "cascading" in "cascading style sheets" is basically the order of precedence that the browser uses to apply style rules. If there are any conflicting declarations, the cascade is the process that sorts it all out and determines which rule will finally win. In other words, the style rule with the highest precedence is the one that is used. One of the simplest forms of precedence is that the style that has been declared last on the page is the one that will be applied – that is, if all other things are equal.

Now that I have given you a brief synopsis of what CSS is, let’s talk about why we need it. In the beginning, well before CSS at least, HTML was used to control the presentational aspects of a page. With web sites becoming increasingly complex, a majority of the code merely determined the appearance of a web site. While this did not create any problems for the end user, it made web site maintenance especially difficult and time-consuming. For example, to change the color of your links, you would need to go to each and every link and change it manually.

So in 1995, the World Wide Web Consortium (W3C) began working on a solution. By 1996, the W3C came up with, you guessed it, CSS. Using CSS to move the presentational information out of the HTML document not only makes web sites easier to update and maintain, but it also has several other benefits, such as cleaning up the code, making the web sites easier to be indexed by search engines, and making websites more compatible with screen readers. CSS also gives you more options and can make a much richer looking web page than HTML ever could.

Resources for CSS Class
Rock Paper Scissors Demo
RockPaperScissors.zip
lesson4.zip
Pixie (Windows Only)

Notes for Mac Users: If you are having trouble using "TextEdit" to view the code of the HTML files, open up the preferences of TextEdit and under "Open and Save" make sure "Ignore rich text commands in HTML files" is checked.

Instead of using Pixie to grab the hex value of a color you can use the Digital Color Meter in the Utilities folder in Applications.  Select "RGB As Hex Value, 8-bit" from the drop down list in Digital Color Meter and when you are over a color you like do a shift-comand-c to copy the value to the clipboard. For some reason when you paste the hex value it has quotation marks around it so don't forget to remove them.  

Some Great Websites to Learn More About CSS
The W3C CSS Home Page
W3Schools CSS Tutorial
Zen Garden



Tags: CSSTECHS




CSS Lesson 2 of 4: CSS Placement

CSS can be placed in three different places in your web site. First, it can be placed in-line within an individual element. Second, it can be inserted at the top of a single web site page. Lastly, it can be in an external CSS file.

In-Line Style
The easiest way, although probably not the most recommended way, to add a CSS style to an element is to put it directly in the tag. You can add an in-line style to any HTML tag as long as it is within the BODY tags of your page. For example, if you wanted to make all of the text within a div tag red, you would do the following:

<div style="color:Red;">Hello there.</div>

You just want to make sure that you do not forget your semi-colons and quotation marks. One thing to note here is that in-line style declarations will get the highest precedence in the cascade and will be applied over any other conflicting rules. Like I said, this is not considered the best way to set a CSS style to a tag. It is little better than the old way of just using basic HTML. Setting all of your styles this way would make your code harder to read and even harder to maintain. But there are times when it can be very handy, especially when creating a web site and you are troubleshooting a particular CSS error or when you want to apply a style quickly so you can see how it looks.

CSS for One Page
If you just want your CSS rules to affect one web page, you can put your CSS all in one location in the HEAD of your document. All you need to do is use the style tag in the head of your web page. The following example tells the browser to show any text within an element that has the class "blue-text" with a blue color and to show any text within an element that has the class "red-text" with a red color.

<head>
    <title>my awesome webpage</title>
    <style type="text/css">
         .blue-text { color:Blue; }
        .red-text { color:Red; }
    </style>
</head>

Site-Wide Style Sheets
The third and most common way to add CSS to your web page is to use an external file with all your CSS rules in it. There is nothing really all that special about the CSS file itself. It is just a plain text file with an extension of .css. You just need to make sure you remember to tell your web page where the CSS file is by adding a link tag in the HEAD of your web page. In your link tag, just make sure you include rel="stylesheet". By the way, "rel" stands for relation. Make sure to set the type to text/css. This is very important because it tells the browser how to import the data.

 <link href="/default.css" rel="stylesheet" type="text/css" />
Tags: CSSTECHS




CSS Lesson 3 of 4: CSS Structure: Part 1


CSS Lesson 3 of 4: CSS Structure: Part 2

A CSS statement or “rule” has two main parts:  the selector and the declaration.  Let's take a look at the selector first.

Element Selectors
There are several different types of selectors.  The most basic type of selector is the HTML element itself.  This allows you to easily apply a set of rules to a certain element type all at once.  For example, if you wanted to make all of the text within a H1 blue, you would do the following:

h1 { color:Blue; }

You can even use two or more elements at the same time as the selector.  You just need to separate them with a comma.  There is really no limit on how many selectors you can have.

h1, h2, h3 { color:Blue; }

Class Selectors
Another way to apply styles to elements is to use the class selector.  Instead of having an element name as a selector, you use a class name preceded by a period.  The period must always be used before the class name because that is what marks it as a class selector.  Using a class selector is probably the most common and beneficial way to add styles to a web site as it enables you to be more selective on which elements the style is applied to.  To use a class with a certain element, simply set its class attribute to the name of the class.  In fact, you can even set several classes to a single element.  Just make sure you have a space between the different class names.  And don't forget that CSS class names are case sensitive.

<html>
    <head>
        <style type="text/css">
            .blue-text { color:Blue; }
        </style>
    </head>
    <body>
        <div class="blue-text">
            This text is blue.
         </div>
     </body>
</html>

ID Selectors
ID Selectors are used a lot like the class selectors but there are a few differences.  Instead of using a period like with the class selectors, you need to use a pound (#) sign, or as I like to call it, the little itty-bitty tic-tac-toe sign.  To use an ID selector, you use the ID attribute of the element.  Unlike classes, IDs can only be used once per page since IDs have to be unique for that HTML page.  Also, don’t forget that just like classes, ID selectors are also case sensitive.

<html>
    <head>
        <style type="text/css">
            #blue-div { color:Blue; }
        </style>
    </head>
    <body>
        <div id="blue-div">
            This text is blue.
         </div>
     </body>
</html>

The Declaration
The correct syntax for a declaration is a property followed by a colon and then a value followed by a semicolon.

h1 { color:Blue; }

In this example "h1" is the selector, "color" is the property, and "Blue" is the value.

One thing to note is that syntax is very important when writing out your declarations.  If you make a mistake or have an invalid declaration or keyword, then the whole rule will just be ignored.

Just like you can group selectors together to make a single rule, you can also group declarations together into a single rule.

h1 { color:Blue; font-family: Arial, Helvetica, sans-serif; font-size: 13px; }

This is definitely the preferred way of defining multiple styles for a single selector.  Just remember to put a semicolon after each declaration.  While it might be valid CSS to leave a semicolon after your last declaration, it is generally not considered good practice and I wouldn’t recommend it.
Tags: CSSTECHS



In this lesson we will write a simple 2 column layout using CSS.

Here is the source code for the demo: lesson4.zip
Here is a link to the color picker program (Windows only): Pixie

Mac users: instead of using Pixie to grab the hex value of a color you can use the Digital Color Meter in the Utilities folder in Applications. Start it up and select "RGB As Hex Value, 8-bit" from the drop down list. Then when you are over a color you like do a shift-comand-c to copy the value to the clipboard. For some reason when you paste the value it has quotation marks around them so don't forget to remove them.


CSS Lesson 4 of 4: Let's Write Some CSS Already!: Part 1


CSS Lesson 4 of 4: Let's Write Some CSS Already!: Part 2


CSS Lesson 4 of 4: Let's Write Some CSS Already!: Part 3


CSS Lesson 4 of 4: Let's Write Some CSS Already!: Part 4


CSS Lesson 4 of 4: Let's Write Some CSS Already!: Part 5
Tags: CSSTECHS



Here is a sample project that can be used as an example for the TECHS class.

http://www.caffeinatedcoding.org/examples/todo/todo.htm

When you enter text into the textbox and once you hit enter(firefox only) or tab, then the page starts a list with the text that was entered into the textbox.  If you don't like the item in the list, click on the text and it is removed.

This is kindof a dumb thing, but it demonstrates how html, CSS, and Javascript can work together.
Below is the code...

For fun put it into a page on your computer and play with it.  Who cares if you screw it up, you can always come back here and get it again.


<html>
<head>
    <title>To Do List </title>
    <style type="text/css">     
<!--
        .inputbox { width:800px; height:100px; text-align:left; vertical-align:middle;  color:#ffffff; font-size:20pt;}
        .listbox { border:1px; border-style:dashed; background-color:#665533; }
        .list { color: #002277; background-color: #665533; font-family: Corbel, Arial Black, Arial; font-size: 30pt;}
        .listitem {  background-color:#774499; width:90%;}
        .listitem-alt {  background-color:#550077; width:90%; }
        body { background-color:#775500; }
        input { font-family: Corbel, Arial Black, Arial; font-size: 30pt; color:#669944; }
--> 
         </style>
</head>
<body >

    <script language="javascript" type="text/javascript">
  <!--
  var blnAlternate;
  
  function AddItem()
   {
   var lstToDo = document.getElementById("lstToDo");
   var txtItem = document.getElementById("txtAddItem");
   if (txtItem.value != '')
       {
           var lstItem = document.createElement("li");

           if (blnAlternate == true)
         {
                   lstItem.innerHTML= "<span class='listitem-alt'  onclick=RemoveItem('" + txtItem.value + "')>" + txtItem.value + "</span>" ;
                         blnAlternate = false;
                        }
     else
         {
           lstItem.innerHTML= "<span class='listitem'  onclick=RemoveItem('" + txtItem.value + "')>" + txtItem.value + "</span>" ;
                         blnAlternate = true;
                         };
     
           lstToDo.appendChild(lstItem);
            txtItem.value='';
           focus=txtAddItem;
          
       };
  
   };
   
  
  function RemoveItem(strItem)
  {
      var lstToDo = document.getElementById("lstToDo");
      for (index=0;index<= lstToDo.childNodes.length;index+=1)
      {
      var lstItem = document.createElement("li");
      lstItem = lstToDo.childNodes[index];
     
      if (lstItem.innerHTML.indexOf(strItem) > 0)
          {
              lstToDo.removeChild(lstItem);
          };
      };
  }
  //-->
    </script>

    <div id="divAddBox" class="inputbox">
    Build your own todo list<br />
    Enter items in the box below and they will appear in the todo list.
        <input type="text" id="txtAddItem" onchange="AddItem()" />
    </div>
    <div id="divList" class="listbox">
        <ol id="lstToDo" class="list"></ol>
    </div>
</body>
</html>

Tags: CSSexamplesHTMLJavascriptTECHS



"It's not what you know, its knowing where to find what you don't know" - Nate

Probably the most interesting thing about working in the computer industry in general is that you most of the time have to find what you need to know, not just take a class and be endowed with information to take you through.  We have compiled a list of some resources that you may find helpful.

Suggested Text Editors for Web Development...

Suggested Image Editors

This is a list of some places we use for online reference when we are coding.

Coding for fun - http://blogs.msdn.com/coding4fun/
    A place to see interesting projects that people have done as hobby coders.

W3Schools - http://www.w3schools.com/
    Excellent resource for many of the web technologies needed to build.

MS Visual Studio Express Beginner Developer Learning Center - http://msdn2.microsoft.com/en-us/beginner/default.aspx
    A nice place to get started for novice developers, or just the curious.

tlbox - http://www.tlbox.com/
    This site has many tools (little helps) in most common web languages that assist in web development.

Free programmer reference ebooks for many different languages.

Programmer Tutorials - http://www.programmertutorials.com/

Tags: resourcesTECHS



  1