How do you like to write JS and DHTML code? [Post: from carefree]

Source: Internet
Author: User

Development Tool: ld5
Development Tool background color: white, gray, light green, light orange
1: do not have any spaces before each sentence.
2: write comments
3: Use 'more than "(easy to input, do not press shift)
4: do not like to write when the statement ends with another line; No.
5: use temporary variable names like str1, str2, temp1, temp2, time1, div1, button1, and font1.
6: Non-essential long-term storage of variables (I .e. temporary variables), do not like to add VaR in front of the character value, direct str1 = OBJ. Value
7: it is annoying. To avoid excessive if and {} numbers, it is often replaced by switch () {Case }.
8: is it easy to use? : Expression
9: When writing multiple statements similar to dhtmlobj. xxx = "XXX" or HTML tag statements, to avoid the difficulty of retrieving long program lines
10: when there are too many variables, you can simply declare the variables in pinyin to remember the variables (do not understand English ~), For example, if the paint brush color box is set to huabiyanse1, the background color box is set to beijingyanse1.
11: When handling the inter-controller array, in order to avoid the impact of subsequent addition, deletion, and update on the original program, you generally do not need to query the index sequence set, use the unique value or question (such as pencil, pen, or circle) of the corresponding control to find it.
12: Ctrl + S save again and again (I am afraid of sudden power failure), F1 debugging in the browser, high frequency
13: I do not like to use DW, FrontPage, and other visual tools to generate html. I like handwriting only.
14: directly write <SCRIPT> do not like to write <script language = 'javascript '>
15: The comment statement is "//". You like to write it with two spaces after the statement ends, for example, obj.. Value= CCC // update the value of xx

[This post was last edited by Yunwu at, September 15,]
Development Tool: EP
Development Tool background color: EP defined, I do not know
1: two spaces are used as indentation without tabs;
2: write comments, but it is basically written after the entire program is finished. This habit is being changed recently;
3: In addition to declaring variables, all newlines can be entered;
4: try to ensure that the number is written. (If you want to take a C language course, do not write it. The number will be finished ......);
5: use temporary variable names like str1, str2, temp1, temp2, time1, div1, button1, and font1;
6: variables that are not stored for a long time (temporary variables) must be added before the value. Remember to add a global variable if VaR is not used;
7: Commonly Used switch () {Case}, but does not reject if-else;
8: is it easy to use if-Else? : Replace the expression because it is fast;
9: When writing multiple statements similar to dhtmlobj. xxx = "XXX" or HTML tag, it is never written in one line;
10: if there are more variables, add a number to the back. What is 12345;
11: when dealing with inter-controller arrays, scholars use document. getelementbyxxx because it is said that cross-browser support ......;
12: Ctrl + S save again and again (I am afraid of sudden power failure), F12 debugging in the browser, high frequency
13: I still like to use DW layout and copy it to EP for modification because I am lazy. Extremely disgusted with FP;
14: Write <SCRIPT> directly during the test, and finish writing <script language = 'javascript '>
15: each function is separated by blank lines, and global variables and functions are also separated;
[This post was last edited at,-11-15,.]

Development Tool: editplus
Development Tool background color: white

1: A tab is indented before each program;
2: each function will write a description comment indicating the usage and parameter usage. The key statement will be added with a concise comment;
3: I am not used to other input methods, so I usually press the keyboard and the mouse is rarely used when writing code;
4: when the statement ends, the number is added. People think it is a good habit to be rigorous;
5: You prefer to use temporary variable names like str_1, str_2, temp_1, temp_2, time_1, div_1, button_1, and font_1;
6: if you do not need to use global variables, VaR is added to the declared variables;
7: do not like switch (). Generally, if else is used to express the process. You do not need to use a single expression {};
8: do simple conditional expressions like to use? : Three-object operation;
9: When writing multiple statements similar to dhtmlobj. xxx = "XXX" or HTML Tag, to avoid long characters, it is generally written by branch;
10: if there are too many variables, you can name them in English. You do not need to declare the variables in pinyin or simply put them together (I am not using pinyin ), for example, variables of the same type are named after obj_border, obj_bgcolor, obj_width, and obj_height;
11: when processing control arrays, it is convenient to use document. getelementbyxxx to obtain the set;
12, you can also save files;
13: I have never used DW, FrontPage, and other visual tools. I like to write them only;
14: click the button to output <script language = 'javascript '>. If it is vbs, change it to VBScript;
15: The comment statement after the expression prefers to enter a blank space and then write "//". The comment statement indicates that you like to write at the beginning of a region/* Start :... */, write at the end/* end :... */;

Fragment code: (because the Forum will convert tabs, the format of the Code posted is no longer correct, and the code is simply deleted)
The above is the final editing of sudden changes

Development Tool: ultraedit
Development Tool background color: Default
1: Each program is strictly indented.
2: love to write comments (there are two types: program segments and program sentences)
3: Use 'more than "(easy to input, do not press shift) I do not know what this sentence means
4: do not like to write the number when the statement ends on another line (this sentence must be;, the program will press; end)
5: use temporary variable names like str1, str2, temp1, temp2, time1, div1, button1, and font1 (use strtemp1)
6: Non-essential long-term storage of variables (I .e. temporary variables), do not like to add VaR in front of the character value, direct str1 = OBJ. Value(Must be added)
7: annoying. To avoid excessive if and {} numbers, switch () {Case} is often used instead (based on the specific judgment conditions, if it is a single value of the two branches, generally, no switch is required)
8: is it easy to use? : Expression (same)
9: When writing multiple statements similar to dhtmlobj. xxx = "XXX" or HTML tag statements, to prevent the program from being too long to search, write in one line (multiple lines)
10: when there are too many variables, you can simply declare the variables in pinyin to remember the variables (do not understand English ~), For example, in the paint brush color box, I start huabiyanse1 and the background color box. Then I start beijingyanse1 (I want to find English words in the dictionary to practice English)
11: When handling the inter-controller array, in order to avoid the impact of subsequent addition, deletion, and update on the original program, you generally do not need to query the index sequence set, use the unique value or question (such as pencil, pen, or circle) of the corresponding control to find it (depending on the specific situation)
12: Ctrl + S save again and again (sudden power failure scared me), F1 debugging in the browser, high frequency (we rarely power off here)
13: I do not like to use DW, FrontPage, and other visual tools to generate html. I like handwriting only (DW layout is good)
14: directly write <SCRIPT> do not like to write <script language = 'javascript '> (add type = "text/JavaScript> to conform to the XHTML Standard)
15: The comment statement is "//". You like to write it with two spaces after the statement ends, for example, obj.. Value= CCC // update the value of XX (Same)
The above is the final editor of Dongfang men.

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.