JS Phase Test

Source: Internet
Author: User

JS Phase Test

First, the choice question

1. The processing file to which the data in the form is to be submitted is specified by the form's ( C ) attribute.

A. Method B. Name C. Action D. None of the above is true

2. in a CSS style sheet, the property that sets whether the div layer is hidden can be (b).

    1. Show:none | Block
    2. Display:none | Block
    3. Display:yes | No
    4. Show:yes | No

3. which of the following variable declarations is wrong ? D

A, the variable name of PHP cannot start with a number

b,php variable names cannot start with special symbols, but special symbols can be inserted in the middle of a variable name

c,php variable names are strictly case-sensitive

d,php variable names can begin with an underscore

4, the following paragraph is a reference to the variable, its correct operation result is ? C

<?php

$a = 68;

$b = $a;

$a = 50;

Echo $b;

$c = 60;

$d =& $c;

$c = 50;

Echo $d;

?>

A. $b =68, $c = 60;

B. $b =50, $c = 60;

C. $b =68, $c = 50;

D. $b =50, $c = 50;

5. what functions are not related to file upload or error ? "Multi-choice" CD

A,move_uploaded_file ();

B,is_uploaded_file ();

C,move_file_uploaded ();

D,move_file_uploade ();

6, PHP's MySQL series functions commonly used to traverse the data of the function is a

A, Mysql_fetch_row,mysql_fetch_assoc,mysql_affetced_rows

B, Mysql_fecth_row,mysql_fecth_assoc,mysql_affetced_rows

C, MYSQL_FETCH_ROWS,MYSQL_FETCH_ARRAY,MYSQL_FETCH_ASSOC

D, MYSQL_FECTH_ROW,MYSQL_FECTH_ARRAY,MYSQL_FECTH_ASSOC

7. The code that hides the layer named mydiv is correct: () c

A. document.getElementById (mydiv). style.display= "None";

B. document.getElementById ("Mydiv"). Style.display=none;

C. document.getElementById ("Mydiv"). style.display= "None";

D. document.getElementById ("Mydiv"). style.display== "None";

8. The result of 13+ "13" + "5" in the JavaScript expression is: ()

A. B. 1217 C. 126 D. 13135

9. when making cascading menu functions , the (b) event of the drop-down list box is called.

A OnClick

B OnChange

C onmouseout

D onmousemove

10, the ability to return keys on the keyboard corresponding to the character of the event is (b) ABC

A OnKeyDown

B onKeyPress

C onKeyUp

D OnMouseOver

11. Which of the common methods of the Window object is a dialog box with a prompt, OK, and Cancel button (b)

A) Open ()

b) Confirm

c) Alert

D) comfirm

12. which is a function of comparing strings ? D

A. Strtolen ()

B. Strops ();

C. substr ();

D. strcmp ();

13. If you want to load the class automatically, which of the following function declarations is correct

A) function AutoLoad ($class _name)

B) function __autoload ($class _name, $file)

C) function __autoload ($class _name)

D) function _autoload ($class _name)

14. after the following script is run,what are the values that the $array array contains? () b

$array = Array (' 1 ', ' 1 ');

foreach ($array as $k = = $v) {

$v = 2;

}

A.array (' 2 ', ' 2 ') B.array (' 1 ', ' 1 ') C.array (2,2) D.array (null,null)

15, execute the following code, enter the result is (d)

<?php

Class a{

Function __construct () {

echo "Echo Class a Something";

}

}

Class B extends a{

Function __construct () {

echo "Echo Class b Something";

}

}

$a =new B ();

?>

A, echo Class A something Echo Class B something

B, Echo Class B something echo Class A something

C, Echo class as something

D, Echo Class B something

Second, the code question:

1. use php to write a simple query, find all the names of "Zhang San" and print out the content

Library name information

Table name User (5 points)

Name Tel Content Date

Zhang San 13333663366 College Graduation 2006-10-11

Zhang San 13612312331 Bachelor's degree from 2006-10-15

Zhang Si 021-55665566 Secondary school 2006-10-15

Please complete the code according to the above topic.

2. There are two data tables, the table User (ID, name) records the users ' IDs and nicknames, the table article (ID, uid,title, content, time) records the title, contents and times of the articles published by the user. Write an SQL statement to print out each user's nickname and the total number of articles it publishes. (5 points)

3. detects if a variable has a function set or not? is the function empty? (2 points)

4. Use two ways to get the extension of a file (10 points)

Requirements:dir/upload.image.jpg, find. jpg or jpg

5. Write a function that implements the following functions: (5 points)
The string "Open_door" is converted to "Opendoor"

1. Convert The string "Open_door" to "Opendoor "

<?php

Function Zhuanhuan ($data) {

$arr =explode (' _ ', $data);

$str = ";

Foreach ($arr as $val) {

$str. =ucfirst ($val);

}

Return $str;

}

7.HTTP status 301, 302 ,304 ,403, 500, code meaning? (5 points)

301 refers to the requested document elsewhere; The new URL of the document is given in the location response header information. The viewer will automatically connect to the new URL.

302 redirect , the new URL will be returned in the location in response , and the browser will use the new The URL sends out a new request.

304   represents that the last document has been cached and can continue to be used .

403 server receives request, but refuses to provide service

Unexpected error occurred on server

8. write The difference between public, protected, and private three access control modes for PHP (or other languages)? ( 3 points)

9. write out the output of the following program (5 points)

<?php

$count = 5;

function get_count () {

static $count = 0;

return $count + +;

}

Echo $count;

+ + $count;

Echo get_count ();

Echo get_count ();

?>

5 0 1

If a script five.php is required every 5 minutes, how is it implemented?

can use js function, SetInterval (5 points)

11.JS Form Popup dialog function? What is the input focus function? (3 points)

12. Write your understanding of Json_encode and eval? (5 points)

through JS to achieve the page forward and backward operation? (5 points)

<a href= "Javascript:history.go (-1);" > Back </a>
<a href= "Javascript:history.go (1);" > Forward </a>

14. Write down the data type of JS? (5 points)

Three ways to get a document node object commonly used in 15.DOM. (5 points)

JS Phase Test

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.