("Userpass"); var uerror=document.getelementbyid ("Errorone"); if(Uname.value.length) {uerror.innerhtml="user name cannot exceed 6-20 length"; } } class="Mubiao"> class="Inputone">User name:"text"Name="User name"Placeholder="Please enter user name">class="Inputone">Password:"Password"Name="Password"Placeholder="Please enter your password">"Errorone">class="Login"> "Login ()"> Member Login h2{Text-align:center;margin-bottom:0;background-color:#66b3ff;}. mubiao{width:500px; height:40
Implementation results:Implementation principle:
Technology stack:
Javascript+jquery+html+css
Implementation steps:
0. Get element
1. The mouse is placed on the carousel chart, showing the control buttons on both sides, and hiding after moving away
2. Control button binding events for both sides (call the same method with only one argument, true for positive rotation, false for reverse rota
mouse away from element onselect text is selected. OnSubmit confirm button is clicked.Two ways to bind eventsMethod 1:Method 2:Event description1.onloadThe OnLoad property is only added to the BODY element in development. The triggering of this attribute indicates that the page content is loaded. Application scenario: When something we want to execute immediately after the page is loaded, you can use the event property.View Code2.onsubmitTriggered when the form is submitted. This
Javascript front-end UI framework Kit User Guide-kitjs event management, kitkitjs
Starting from today's chapter, I will focus on the event management of KitJs, try to use plain language to reveal how the mainstream js framework implements its own independent event management function internally.
(1) Common Dom events
We generally support writing events in HTML
O
Implementation results:The implementation effect is as shownImplementation principle:What is a somersault cloud effect:
The effect is simple, that is, when you move the mouse over the other navigation directory, there will be a background image to slide to the current directory with the mouse.
Implementation ideas:
When the mouse passes, use offsetleft to get the distance from the left side of the current box and assign this value to the
In front-end development, you often need to determine the browser version to ensure compatibility with multiple browsers at the same time. Below are two good common methods: Comments in jquery and HTML, if you like it, you can refer to the following methods to search for browsers and versions on the Internet. Here, the younger brother sums up two methods to save your time.
1. jquery method:
Regular Expr
://blog.chinaunix.net/uid-10540984-id-3130355.html)The Http protocol defines a number of ways to interact with the server, with four basic types:GET,PUT,POST, DELETEthe header information for HTTP includes the general header, the request header, the corresponding header, and the four parts of the entity head. Each header field consists of a domain name, a colon (:), and a domain value of three parts. 1. The generic header is a header that both the client and server can use to provide some usefu
...in statement is an accurate iterative statement that is often used to enumerate the properties of an object and then get the property value
var userInfo = {userName: "Li full", userage:25, Usersex: "Male"}for (key in UserInfo) {Console.log (key, '-a ', US Erinfo[key])}
Break and Continue statements:Description: The break and continue statements are used to precisely control the execution of the code in the loop, where the break statement exits the loop immediately, forcing the exe
Arrays Array
declaring an array
Working with Arraysmethod used : array name [ index value ]; the name of the function ();The index number starts at 0. 0 1 2 3 4 5 ...The length of the arrayarray name . length;Iterating through an arraythink of the for traversal arrayCharacters connected+Add Value characters ConnectedThe value that all input takes is the character type. Ternary operatorsThree mesh operatorOne dollar: a++ b++ +a-atwo USD : A+b a>=bternary : an expression? Results 1: Results 2
']= ' li full// often newobj.name= ' Liu Jianjin '/** How to get properties when individually accessed */var name=newobj[' name ']console.log (name) varname=newobj.nameconsole.log (name)/* * Traverse All Properties **/for (keyinnewobj) {console.log (' key-> ' +key, ' val-> ' +newobj[key])}/** Delete related properties **/deleteNewobj.name
Note: An object can be passed as an argument to a function, and an object can carry countless attributes, so the preferred way to pass an optional pa
Alert (' 1 ' + 1)//11, not 2, this easy to forgetThe second question, it's all basic, it's easy to fall out of the pit.(function() { var a = b = 6;}) () Console.log (b); // 6 global variable declarationIn advance of the third question statementfunction Test () { console.log (a); Console.log (foo ()); var a = 1; function foo () { return 2; }} test ();This is simple.var fullname = ' John Doe '; var obj = { ' Colin ihrig ', prop: { ' Aurelio De Rosa ', function() {
Quotaexceedederror exception when setting the Localstorge value in the non-trace mode.Third, hash tableA hash table, also known as a hash table, is a data structure that is accessed directly from a key value. That is, it accesses records by mapping key code values to a location in the table to speed up lookups. This mapping function is called a hash function, and the array that holds the record is called the hash table.Given table M, there is a function f (key), for any given keyword value key,
JS in the function key word is function, note the following:function Add (NUM1, num2) {return NUM1 + num2;}1, if the incoming var sum = Add (1, 6, 7); Only 1 and 6 are taken, and the last extra parameter is ignored.2, if only add (1) is passed in, a nan is obtained because the function's formal parameter num2 is treated as undefined3, the inside of the function has a arguments array, which is used to store the parameter list passed in, as the following is all the input parameters.function Add (A
This section mainly through an adder, describes how JS debugging. First on the code:Test.html:Demo.js/** * Created by Yanzi on 15/12/8. */var NUM1 = document.getElementById ("Num1"), num2 = document.getElementById ("num2"), result = document.getElementById ("result"), Btn_add = document.getElementById ("add"); Btn_add.addeventlistener ("click" , Onaddclick, False), function Onaddclick () { var a = parseint (Num1.value), B = parseint (num2.value); var sum = Add (a, b); result
There is a problem when using Ajax to leave a message. Since the message content is written, the content is submitted via Ajax, and the content of the message is added to the page using JS. When you view the message, it is also requested by Ajax and then displayed. So, if someone wrote a JS statement in the message, This statement will be executed. The solution is to escape these special characters and display them again. If you use the JSTL tag in your JSP, it's easy. Use 1:var html= " 7: Preve
Reference: https://hoofoo.me/article/2017-04-11/%E8%B5%9B%E7%A0%81%E7%BD%91%E5%89%8D%E7%AB%AF%E7%AC%94%E8%AF%95%E6%9C% Ac%e5%9c%b0%e7%8e%af%e5%a2%83%e6%90%ad%e5%bb%ba.htmlImplementation of the Print methodThis is no difficulty, just console.log change the name of the thing, a line of code can be solved.var print = Console.logimplementation of Read_line methodAs we Node.js all know, it is an asynchronous language, so it is readline also an asynchronous operation, according to the node. JS Chinese
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.