First, the basic part:
1. What is JavaScript?
is a scripting language , is a weak type (language grammar is very casual), C # is strongly typed (language syntax is very strict)(Li brainstorming lxc)
Advantages: JS execution Speed is fast
2. What is the relationship between JS and Java? It doesn't matter.
3, JS can do what things?
Ability to control browser BOM
Control Element DOM
JS can't do what?
Cannot manipulate files (read, create, delete)
Cannot Access database directly
Extension: node. JS-a development platform through which you can develop a regular web service side, a very lightweight running environment
Jquery.js-Front frame
4, JS is a process-oriented language also some people say JS has object-oriented, but he is not a purely object-oriented language
Second, the common dialog box
Alert ("string")-warning dialog box, popup string content
Confirm ()-Confirmation dialog box
Prompt ("", "")-Input dialog box
Third, JavaScript syntax
1. Basic Data type
String, Decimal, Integer, Date time, Boolean type
2. Variables: Only one type var (universal variable)
3, data type conversion string type highest precedence
<script type="text/javascript">var a=; var b="ten"; var c=++ + C ++ C + parseint (b)); </script>
4, text box digital verification (Li Brainstorming lxc)
<script>varTxt1 = document.getElementById ("TextBox1"); //trigger when button is liftedTxt1.onkeyup =function () {if(IsNaN ( This. Value)) { This. Value = This. VALUE.SUBSTR (0, This. value.length-1); } }; //Txt1.onchange = function () {};//triggered when the focus is lost//Txt1.onkeydown = function () {};//triggered when the button is pressed</script>
5. Operators with C #
6. Statements
Branch Statement If...else If...else
Loop statement for (int i=0;i<=k;i++) {}
7. Arrays
Similar to collections in C #, not fixed-length, non-fixed type
Assignment: Assign a value directly with an index without add
Empty: With a foreach loop, array[i]=null;
Quantity: Length;
8. Functions
No parameter no return, no return, no parameter, no return, no parameter returned type, direct return
Recursion: Self Tune Yourself
Iv. BOM Operation
1. window.open-Open Page
window.open ("page path", "Whether new form", "new form format");
New form format: width, height new form wide height left, top new form position
Open a new form is not able to change the contents of the Address bar
2, Opener: Open the source window of the current window, if the current window is the first time the browser opened, then opener is null;
Window.close ();
Window.opener.location.href= "";
Reopen the previous form and guide the URL, if it is a previous level URL, there is a refresh effect
: Click Button2 to close Button1 open form
3, window.navigate ("url"), jump to the target page
Window.moveto (x, y); Move page to coordinates
Window.resizeto (width,height); Change page length and width
Window.scrollto (x, y); scroll page to where
4, Window.history.back (); page back
Window.history.forward (); page forward
Window.history.go (n); page jump to
C#-webform-js Chuanjiang: Basic part, BOM part, Dom part