Discussion :  SOU CS Classes The fastest message board... ever.
Forum for discussion, questions, and replies relating to Web Development I 
Goto Thread: PreviousNext
Goto: Forum ListMessage ListNew TopicSearchLog In
Week 5 - Friday Discussion
Posted by: harveyd (IP Logged)
Date: October 25, 2007 04:18PM

1.Fix a bug or answer a question
i.<script>alert("hello");</script>
ii.<script language="javascript1,3">
iii.Why is the type attribute needed in the script tag?
iv.What does the JavaScript alert command do?
v.Why is it a good idea to end JavaScript statements with a semi-colon?
vi.Why does alert("hello"); require quotes around the hello statement.
vii.What is wrong with the javascript statement, alert(“hello”);?
viii.Why does JavaScript allow either single of double quotes to surround the hello in alert("hello");
ix.What are two ways to make comments in JavaScript? How do they differ?
x.Why is the following not XHTML compliant, even though it works on many browsers?
<script type="text/javascript"><!-- browser doesn’t like javascript -->/* javascript statements go here */</script>
xi.How do you link to an external text file with JavaScript in it?
xii.In what order do browsers execute scripts?
xiii.Create a JavaScript variable called ‘value’.
xiv.Declare a variable called z.
xv.Declare two variables x and y.
xvi.Declare a variable name that contains an initial value.
xvii.Create an assignment statement that concatenates the strings "abc" and "def"
xviii.What is the difference between prompt, confirm, and alert?
xix.What is the difference between alert and document.write?
xx.What is an escape (break) sequence? Give an example.
2.There are five generations of program languages.
i.Tell us something about any of these generations of languages?
ii.Where does JavaScript fit in?
iii.What is a variable? Why are variables important?
iv.What are the rules for naming variables?
v.What is a break sequence? Give an example.
vi.What is an identifier?
vii.What are three types of programming errors that are possible? Which of these apply to XHTML?
viii.What is string concatenation? How do you do it in JavaScript?
ix.What is SQL?
x.Why can't JavaScript access data on the server computer?
xi.What is the difference between an interpreted language and a compiled language?
xii.What is a problem with client side scripting languages avoided by using server a side scripting language?
3.Describe the three types of control structures that programming languages employ to create all programs, no matter how complex.
4.What is a variable any are variables important?
5.What is an assignment statement?
6.Why does '=' and '==' mean different things in JavaScript?
7.What are the similarities in syntax between JavaScript and many other languages (ex: C, C++, Java, Perl, Php, etc.)?
8.People often get Java and JavaScript confused. What are some differences?
9.What are differences between JavaScript and Jscript?
10.What are differences between JavaScript in different browsers?
11.What is a good discussion topic for future classes?
12.What would be a good lab project?
13.Create a test question that you think would be good to add to either the on-line lecture, for a synthesis question, or for a quiz. Answer your question.
14.What do you wish you knew at the start of the lab project?
15.What suggestions do you have for the on-line lectures, lab projects, power point slides, etc.?
16.What mistakes did you find in the on-line material?



Edited 1 time(s). Last edit at 10/25/2007 04:18PM by harveyd.

Re: Week 5 - Friday Discussion
Posted by: (IP Logged)
Date: October 26, 2007 10:53PM

i.<script>alert("hello");</script>

<script>
alert("hello")
</script>

Note from Dan: The semi-colon should be part of the script. It is not necessary to span three lines. There is another error.

ii.<script language="javascript1,3">

<script language="JavaScript1.3"></script>
The most recent version is 1.5. Therefore, there is no JavaScript1,3.

Note from Dan: The problem here is not the version number. The problem is that the language attribute is depricated.

5.What is an assignment statement?

The assignment statement means take the value that is on the right side an copy it over to the left side. When there are mathematical operations (+ and - for addition and subtraction and * and / for multiplication and division) on the right side, the browser does them from left to right. For example,

var theResult, anotherResult, result3
theResult = 5 + 4
anotherResult = 8*3
result3 = 20 / 5

Therefore, the variable theResult will have the value 9, anotherResult will have the value 24, and result3 will have the value 4.



Edited 1 time(s). Last edit at 10/29/2007 03:00PM by harveyd.

Re: Week 5 - Friday Discussion
Posted by: (IP Logged)
Date: October 27, 2007 06:49PM

ix.What is SQL?

SQL stands for Structured Query Language. SQL is used to communicate with a database. It is the standard language for relational database management systems. SQL statements are used to perform tasks such as update data on a database, or retrieve data from a database. Some common relational database management systems that use SQL are: Oracle, Sybase, Microsoft SQL Server, Access, and Ingres.

Re: Week 5 - Friday Discussion
Posted by: (IP Logged)
Date: October 28, 2007 09:53PM

1.Fix a bug or answer a question
vi.Why does alert("hello"); require quotes around the hello statement.
The alert method requires uses a string. The quotation marks identify hello as a string. The other way to use the alert method is by passing a variable.

2.There are five generations of program languages.
viii.What is string concatenation? How do you do it in JavaScript?
Concatenation is adding strings together. Strings are concatenated with the + sign. alert("hello " + "world") would be be the same as alert("hello world").

3.Describe the three types of control structures that programming languages employ to create all programs, no matter how complex.
sequences determine which instructions are executed. Conditions determine which branch of code to execute after a condition has been met. Loops repeated execute the same instructions.

Re: Week 5 - Friday Discussion
Posted by: (IP Logged)
Date: October 29, 2007 12:04AM

x.Why can't JavaScript access data on the server computer?

JavaScript is a client-side scripting language, so it can't access the server. For example, you can't use JavaScript to store data on the server or retrieve data from the server. But you can use JavaScript and PHP together to produce Web pages that neither can produce alone.

vii.What is wrong with the javascript statement, alert(“hello”);?

corrected:

<script type="text/javascript">
alert("Hello");
</script>

Re: Week 5 - Friday Discussion
Posted by: (IP Logged)
Date: October 30, 2007 05:21PM

xii.In what order do browsers execute scripts?

Browsers execute scripts and HTML code from top to bottom.

iii.What is a variable? Why are variables important?

A variable is like a storage box where a value is placed for future use. It is called a variable because the content (a value) within the box may vary during the execution of a script. Variables store values such as a string (a string of characters) or integers (numbers) or Boolean values such as true or false. A variable is important because it in essence represents a memory location.

iv.What are the rules for naming variables?
Variables must each have a unique name so as to differentiate it from another variable. Variable names must start with a character, a letter from a to z or A to Z or an underscore character (_) but not a digit. After the first character the characters may be a letter, a digit or the underscore character. There should be no spaces between characters. In a multi-word variable name distinctions between the words must be made either with an underscore character or by capitalizing the first character of the next word. Examples of these are:
var zip_code_1
or
var zipCode1

Re: Week 5 - Friday Discussion
Posted by: (IP Logged)
Date: October 31, 2007 05:24AM

2.There are five generations of program languages.
i.Tell us something about any of these generations of languages?
High level programming is readable by humans. It tells the computer what to do and how to do it step by step.
ii.Where does JavaScript fit in?
JavaScript is a scripting programming language. It is interpretive, and designed to work with HTML to make dynamic web pages

Re: Week 5 - Friday Discussion
Posted by: (IP Logged)
Date: November 18, 2007 10:44PM

xix.What is the difference between alert and document.write?
document.write
<html>
<body>

<script type="text/javascript">
document.write("Hello World!")
</script>

</body>
</html>
alert
<html>
<head>
<script type="text/javascript">
function display_alert()
{
alert("I am an alert box!!")
}
</script>
</head>
<body>

<input type="button" onclick="display_alert()"
value="Display alert box" />

</body>
</html>



Sorry, only registered users may post in this forum.
This forum powered by Phorum.