CS350 Internet Applications Name: ____________________________

colonteeΛογισμικό & κατασκευή λογ/κού

4 Νοε 2013 (πριν από 3 χρόνια και 11 μήνες)

115 εμφανίσεις

1

of
6


CS350 Internet Applications




Name:

_____
____________________
___


1.

Inside which HTML element do we put the JavaScript?

(A.)

<js>

(B.)

<scripting>

(C.)

<javascript>

(D.)

<script>


2.

What is the correct JavaScript syntax to write "
CS350 Rocks!
"?

(A.)

document.write("
CS350 Rocks!
")

(B.)

response.write("
CS350 Rocks!
")

(C.)

("
CS350 Rocks!
")

(D.)

"
CS350 Rocks!
"


3.

Where is the correct place to insert a JavaScript?

(A.)

The <head> section

(B.)

The <body> section

(C.)

Both the <head> section and the <body> section are correct


4.

What is the correct syntax for referring to an external script called

"
myscript.js
"?

(A.)

<script type="text/javascript" href="
myscript.js
">

(B.)

<script type="text
/javascript" src="
myscript.js
">

(C.)

<script type="text/javascript" name="
myscript.js
">


5.

The external JavaScript file must contain the <script> tag

(A.)

True

(B.)

False




2

of
6


6.

How do you write "
CS350 Rocks!
" in an alert box?

(A.)

alertBox("
CS350 Rocks!
")

(B.)

alert("
CS350 Rocks!
")

(C.)

msgBox("
CS350 Rocks!
")

(D.)

alertBox="
CS350 Rocks!
"


7.

How do you call a function named "validateForm"?

(A.)

call function validateForm

(B.)

validateForm()

(C.)

call validateForm()


8
.

How do you create a function?

(A.)

function=
validateForm
()

(B.)

function:
validateForm
()

(C.)

function
validateForm
()


9.

How do you write a conditional statement for executing some code if "
x
"

is
equal to
7
?

(A.)

if
x
=
7

then

(B.)

if
x
=
7

(C.)

if
x
==
7

then

(D.)

if (
x
=
7
)

(E.)

if (
x
==
7
)


1
0
.

Ho
w can you add a comment in a JavaScript?

(A.)

//This is a comment

(B.)

<!
--
This is a comment
--
>

(C.)

'This is a comment




3

of
6


1
1
.

What is the correct JavaScript syntax to insert a comment that has more

than one line?

(A.)

/*This comment has

more than one
line*/

(B.)

//This comment has

more than one line//

(C.)

<!
--
This comment has

more than one line
--
>


1
2
.

Which of the following is correct?

(A.)

jQuery is a JSON Library

(B.)

jQuery is a JavaScript Library


13
.

jQuery

uses CSS selectors and XPath expressions to select elements?

(A.)

False

(B.)

True


14
.

Which sign does jQuery use as a shortcut for jQuery?

(A.)

the ? Sign

(B.)

the % sign

(C.)

the $ sign


15
.

With jQuery, look at the following selector: $("div"). What do
es it select?

(A.)

The first div element

(B.)

All div elements


16
.

Is jQuery a library for client scripting or server scripting?

(A.)

Client scripting

(B.)

Server scripting


4

of
6


17
.

What is the correct jQuery code to set the background color of all p

elements to red?

(A.)

$("p").style("background
-
color","red");

(B.)

$("p").css("background
-
color","red");

(C.)

$("p").manipulate("background
-
color","red");

(D.)

$("p").layout("background
-
color","red");


18
.

With jQuery, look at the following selector:
$("div.intro"). What does it

select?

(A.)

All div elements with class="intro"

(B.)

The first div element with id="intro"

(C.)

The first div element with class="intro"

(D.)

All div elements with id="intro"


1
9
.

Which jQuery method is used to hide selected e
lements?

(A.)

display(none)

(B.)

hide()

(C.)

hidden()

(D.)

visible(false)


20
.

Which jQuery method is used to set one or more style properties for

selected elements?

(A.)

css()

(B.)

style()

(C.)

html()


21
.

What is the correct jQuery code for making all di
v elements 100 pixels

high?

(A.)

$("div").height(100)

(B.)

$("div").yPos(100)

(D.)

$("div").height="100"




5

of
6


22
.

Which statement is true?

(A.)

To use jQuery, you can refer to a hosted jQuery library at Google

(B.)

To use jQuery, you do not have to do
anything. Most browsers (Internet
Explorer, Chrome, Firefox and Opera) have the jQuery library built in the
browser

(C.)

To use jQuery, you must buy the jQuery library at www.jquery.com


23
.

What scripting language is jQuery written in?

(A.)

C++

(B.)

C#

(C
.)

VBScript

(D.)

JavaScript


24
.

Which jQuery function is used to prevent code from running, before the

document is finished loading?

(A.)

$(body).onload()

(B.)

$(document).ready()

(C.)

$(document).load()


25
.

Which jQuery method is used to switch between
adding/removing one or

more classes (for CSS) from selected elements?

(A.)

toggleClass()

(B.)

switchClass()

(C.)

altClass()

(D.)

switch()


26
.

Look at the following jQuery selector: $("div#intro .head"). What does it

select?

(A.)

All div elements with id="
intro" or class="head"

(B.)

The first element with id="head" inside any div element with class="intro"

(C.)

All elements with class="head" inside the first div element with id="intro




6

of
6


27
.

Is jQuery a W3C standard?

(A.)

Yes

(B.)

No


28

Which regular
-
expression
matches
a birthdate?

(A.)

/^[
\
d]{3}
-
[
\
d]{2}
-
[
\
d]{4}$/

(B.)

/^[(][
\
d]{3}[)][
\
d]{3}[
-
][
\
d]{4}$/

(C.)

/^[
\
w]+$/

(D.)

/^[
\
d]{1,2}[
-
/][
\
d]{1,2}[
-
/][
\
d]{4}[
-
/]$/


29

Which regular
-
expression
matches
a phone number?

(A.)

/^[
\
d]{3}
-
[
\
d]{2}
-
[
\
d]{4}$/

(B.
)

/^[(][
\
d]{3}[)][
\
d]{3}[
-
][
\
d]{4}$/

(C.)

/^[
\
w]+$/

(D.)

/^[
\
d]{1,2}[
-
/][
\
d]{1,2}[
-
/][
\
d]{4}[
-
/]$/


30

Which regular
-
expression
matches
a name?

(A.)

/^[
\
d]{3}
-
[
\
d]{2}
-
[
\
d]{4}$/

(B.)

/^[(][
\
d]{3}[)][
\
d]{3}[
-
][
\
d]{4}$/

(C.)

/^[
\
w]+$/

(D.)

/^[
\
d]{1,2}[
-
/][
\
d]
{1,2}[
-
/][
\
d]{4}[
-
/]$/