Code highlightingIt is useful, especially when you need to display your own code on a website or blog, or check or debug syntax errors for others. We can supportCode highlightingSo that readers can easily read code blocks and improve the user's
During Web development, we often use the page Close event onbeforeunload to give users a chance to stop the event, such as this blog editor. If you choose to exit, the onunload Event will naturally be triggered. But if you choose to cancel, how can
12 super-cool Javascript navigation menu codes are collected, which are resources from foreign websites. Due to the time relationship, these menu codes are not provided for packaging and downloading, however, you can select your favorite menu based
Asynchronous submission of form data has two pain points:
1. garbled Coding
In fact, the bottom layer of ajax technology is unicode encoding. garbled code occurs when GBK pages interact with interfaces. There are multiple solutions, which can
In the transition module of YUI3.2.0, other operations are performed after the transition is completed by using the transition: end event. In YUI3.3.0, this event type is no longer recommended. The following two methods are adopted:
First, directly
If you know a little about JS Code, you will generally knowwindow.location.hrefThis attribute. Use this property to obtain the URL of the page:
window.location.href = window.location.href;
Okay, I tell you, it's so weak. In fact, native JavaScript
LieHuo76.Net teaches 79 Cheng a very simple and common JS to get the URL code of the current webpage. In fact, this is a useful function, sometimes we do not want to use dynamic Web languages such as ASP, PHP, and JSP to intercept strings in URLs.
JavaScript judges whether the browser is closed or refreshed. In fact, it seems that there is no practicality, even as a reference document for Js learning.
Js smart judgment on whether the browser is closed or refreshed Close or refresh the
Javascript displays "Sort favorites" on the webpage. This function has security risks, so it cannot be implemented in higher IE versions. Click the link on the webpage to display the "organize favorites" dialog box, which is similar to the "add
In Firefox, when the number of innerHTML operations is large, the performance will be greatly reduced. Someone wrote an alternative method to improve the performance of innhtml:Function replaceHtml (el, html ){Var oldEl = typeof el = "string "?
This article on cool shell is attractive: Checking regular expressions of prime numbers
The Code translated into JavaScript is as follows:
Copy to ClipboardReference: [www.bkjia.com] function prime (MAX ){
Var re =/^ (11 + ?) \ 1 + $ /,
N, C = '1
This is an image viewer using javascript. the next exit code is displayed at the layer. Pay attention to the functions $ (), addEvent (), and removeEvent () in the code () these functions are not encapsulated in the Image Viewer. I personally think
1) the parameters in the sending path are in Chinese, and the received parameter values in the server segment are garbled.For example:Var url = "a. jsp? Name = Xiao Li ";XmlHTTP. open ("post", url, true );Solution:Use the escape () or encodeURI ()
When learning javascript, we need to take a closer look at the following questions:
1. javascript callback function
2. Cross-Site Request for Cross Domain
3. Class
4. Design Mode
5. namespace
6. Various browser standards
7. Algorithms
8.
A few days ago, in order to improve the tree-based permission selection function, jquery was used to write a method based on the tree structure. The result of this method is: "When a node is selected, the selected status of its child nodes also
JavaScript is an Object Oriented Programming (OOP) language.JS is an object-oriented programming language (Object-Oriented ).An OOP language allows you to define your own objects and make your own variable types.The OOP language allows you to
If the requirement for dynamic client interaction is relatively high and elements need to be added frequently and dynamically in the DOM, performance problems may occur, so DocumentFragment may be used. For more information, see the following
Problem:
When ASP. NET is used in combination with JQuery + Ashx to load the message system, extract the Message ID from the message data read by PAGE and then query the reply content corresponding to the message using Ajax. The Code is as
[1. The most basic pop-up window Code]
Copy to ClipboardReference: [www.bkjia.com]
Because it is a piece of javascripts code, they should be placed between the . are used for some earlier browsers, and the code in the labels is not displayed as
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