Html,css,javascript

Source: Internet
Author: User

1, picture call,

2, page jump, <a href= "" ></a>3, horizontal line, generally from the left end of the window has been drawn to the far right, <select name= "like" id= "#" ><option value= "very like" > very much </option><option value= "just ss" > still likes </option><option value= "not so much" > don't like </option><option value= "hate" > Very dislike </option></select></form>13, <a href= "" ></a>14, HTML selector, class selector, related class selector, a.classname, standalone class selector,. ClassName, ID Selector 15, the body does not have that attribute, join the inline CSS style to style= ""; (Can be adjusted, is bgcolor) 16, var An_array = NewArray ("Hickory", "dickory"), 17, the correlation array and the above array is the same, but it does not use numbers to index, but to use words to index. 18. To save multiple cookies, just give each cookie a different name. If you are adding a new cookie, setting Document.cookie does not delete the previously set cookies, so: var The_cookie = "My_happy_cookie=happiness_and_joy"; Document.cookie = The_cookie; var another_cookie= "my_other_cookie=more_joy_more_happiness"; Document.cookie = Another_cookie19, but if you want to keep the cookie on the user's machine you need to set a time for the cookie to expire, which is a special format called GMT. Fortunately JavaScript has a date method called toGMTString that can help you.

20,cookie path and domain, there is a piece of JavaScript asked the user's name, you may need to in your another

Pages, such as a home page, to access a given name. So you have to set the path to the cookie. The path "path" is used to set the topmost directory where a cookie can be read. Setting the path of the cookie to the top-most directory of your page allows all pages in that directory to have access to the cookie. 21, the second page: How to give the event timing in JavaScript to the event timing is easy. The key directives are the settimeout () and the Cleartimeout () methods. With settimeout (), directives can execute specific instructions at a specified time in the future. 22, to make the timer loop work you need to write a function to implement the loop call. Here is an example:  var The_count = 0;var the_timeout;function dotimer () {    window.document.timer_form.the _text.value = the_count;    The_count + = 2;    the_timeout = SetTimeout ("DoTimer ();", 2000);}  23, and the Infinite "while" loop locks the browser's work, and the browser cannot execute any other instruction at the same time during the execution of the loop. The settimeout, in turn, allows the browser to perform other work in the loop gap. 24. The problem arises because you pass a variable to settimeout. You can avoid this problem by passing the value of the variable instead of the variable itself to settime:  function alertinaminute () {    var the_string = "Hello";     the_timeout = SetTimeout ("alert (" + the_string + ");", 60000);}   This code pulls the variable the_string from the settimeout quotation marks, and JavaScript can find the value of the variable from memory because the variable is not currently in the settimeout quotation mark. &NBSP;25, each browser has a navigator object in addition to the document object, and navigator has two properties that contain all the information about the type of browser you are using: AppName and AppVersion.26, for example, we know that some browsers support image substitution, and some do not. Fortunately, you can detect whether the browser has this feature: simply detect if the browser has a Document.images object:  if (document.images) {    do lots of image swap Stuff} 27, History contains a list of the URLs that your browser has visited. The historical object allows you to take advantage of Window.history.back () and Window.history.forward () Switch back and forth in the list of entries. The function of back is consistent with the back button on your browser. 28,  window.document.forms[0].elements[0].value = "hello!"; Window.document.forms[the_form_name].elements[the_element_name].value = "hello!"; Window.document.the_form.the_text_box.value = "hello!"; var the_element_string = "window.document." + The_form_name + "." + The_element_name; var the_element = eval (the_element_string); The_element_string.value = "hello!";  29, the key is to learn how to effectively debug your program. I have some tips to help you solve why the program doesn't work as it should, or to help you avoid writing a lot of wrong code first,:  to print out variables in different ways. Note The general error code before you think about 30, adding some warning dialogs to your code is helpful. Unfortunately, it is also a pain to press "OK" every other row.   can debug code without warning dialogs. One option is to write debug information to a text area of the form. Another possibility is to write debug information on another window. Here is an example of debugging code that writes debug information in the following text area.   The third trick to make your debugging experience more comfortable is this: Create a different debug level, and then set the debug variable. 31, please note that I have defined a variable called "Debug", it can be "none", "alert" or "textarea".So when I want to generate an error message, I give it to the function doerror (), this function may do nothing, or display a message dialog box, or paste the message into a text area 32, limit the amount of work in the loop   custom If-then-else statements, Minimize recurring expressions, such as pi  , in the most likely to the most unlikely order

Html,css,javascript

Related Article

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.