Michael G's Blog

Guest Speaker

Posted in Advanced Scripting by michaelg1980 on February 17, 2010

Excellent speaker. Kudos, Gina, for snagging him. 😀

I forgot his name, but his enthusiasm and dedication was most impressive.  The thing I came away with was “Love what you do and do it will all your heart.”  In a nutshell.  It sounds cliche to say it and write about it, but “being proactive” was what it boiled down to for me.  He said it more than once, “If you don’t love graphic design, get out of it.  It will eat you up if you don’t love it”  By extension, “If you don’t love web design, then get out…”  And, this is where I found myself in relation to the speaker.  He obviously loves what he does, and I know what I would love to do, and it’s not graphic or web design.  Though I’m sure graphic and web skills  will come in handy a little later.  No, I am not a designer.  I am an artist.  An educated artist.  It is my earnest and passionate intention to open and curate a gallery.  Doing this, I imagine I too will exude the same spark, the same energy, focus and power I saw in the speaker earlier today.

“Don’t ask yourself what the world needs. Ask yourself what makes you come alive and then go do that. Because what the world needs is people who have come alive.” ~Howard Thurman

What’s going on below?

Posted in Uncategorized by michaelg1980 on February 16, 2010

The code:

<!DOCTYPE html PUBLIC “_//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

<html xmlns=http://www.w3.org/1999/xhtml>
<head>
<meta http-equiv=”Content-Type” content=”text/html; hcarset=UTF-8 />
<title>Untitled Document</title>
<style type=”text/css”>
.urgent {
color : red;
font-weight : bold;
font-size : 20pt;
}
.notsourgent {
color : blue;
font-weight : normal;
font-size : 70%;
}
</style>
<script type=”text/javacript”>
function makeLessUrgent() {
document.getElementByID(“urgentmessage”).classname=”notsourgent”;
} This javscript defines a function named “makeLessUrgent.” It looks for an element id “urgentmessage” and replaces its style with the class “notsourgent” defined in the head above.
</script>
</head>
<body>
<div class=”urgent” id=”urgentmessage”>THIS IS URGENT!</div>
<br />
<input type=button id=”msgbtn” size=”20” value=”Dealt with”
onclick=”makeLessUrgent();” /> Here the function “makeLessUrgent” gets actived “onclick” by the button.
</body>
</html>

Link to my non-working javascript homework. Yay!

What’s this stuff mean?

Posted in Advanced Scripting by michaelg1980 on February 2, 2010

The Javascript File Code:

// initialize the counter and the array
var numnames=0;
var names = new Array();
function SortNames() {
// Get the name from the text field
thename=document.theform.newname.value;
// Add the name to the array
names[numnames]=thename;
// Increment the counter
numnames++;
// Sort the array
names.sort();
document.theform.sorted.value=names.join(“\n”);
}

The HTML Code:

<html>
<head>
<title>Array Sorting Example</title>
<script type=”text/javascript” language=”javascript” src=”sort.js”> <<This part links to the Javascript file above
</script>
</head>
<body>
<h1>Sorting String Arrays</h1>
<p>Enter two or more names in the field below,
and the sorted list of names will appear in the
text area.</p>
<form name=”theform”>  <<Here’s where the form is first identified so that the statement “document.theform…,” in the function SortNames, knows where to go and grab something.
Name:
<input type=”text” name=”newname” size=”20″>   <<This is the place the value “newname” is entered by the user and located by the  statment “thename=document.theform.newname.value;” in the function SortNames.
<input type=”button” name=”addname” value=”Add”
onclick=”SortNames();”> <<This is where the function SortNames is activated by user’s click.
<br>
<h2>Sorted Names</h2>
<textarea cols=”60″ rows=”10″ name=”sorted”>  <<Here, the text area “sorted” is identified, so the method “names.sort” knows where to put the data identified by the property below it: “document.theform.sorted.value=names.join(“\n”);”
The sorted names will appear here.
</textarea>
</form>
</body>
</html>

A Link to my first array!