Seven Practical Javascript code highlighting scripts

  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

Obtain and submit form data Asynchronously

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

JavaScript getScrollHeight () instance

JavaScript getScrollHeight () instance Function getScrollHeight (){Var maxDisplacement = 0;Window. scrollTo (0, 000 );If (typeof self. pageYOffset! = 'Undefined ')MaxDisplacement = self. pageYOffset;Else if (document. compatMode & document.

Insert a character or expression at a specified position in textarea

JQuery inserts a character or expression at a specified position in textarea. This example requires you to introduce the jQuery framework into the webpage and the following code should also be introduced:Copy to ClipboardReference: []

The shutter opens the webpage and a line of Js code can be implemented.

When the shutter opens the webpage, a line of Js code can be implemented. This is a kind of webpage transition effect. When the link is opened, wait for the page to load and display it slowly in the form of a shutter, the Code is also very simple.

Use JS in Chrome to obtain the CSS width and height of tables and their elements

Although few tables are currently used, some writing operations still need to be used. Today, when I was working on the F7Dialog2.0 project, I encountered the CSS width and height for getting table cells. I think it is very easy to get the width and

Improves Firefox's innerHTML () Performance

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 "?

The input box only supports Chinese characters, numbers, and integers.

Use JS to restrict the input box to only Chinese characters, numbers, integers, and other effects. There are multiple types of code, which may help you and focus more on helping customers. First, only numbers and decimal points are allowed.Second,

Js acquisition date: the day before yesterday, yesterday, today, tomorrow, and the day after tomorrow

Js Code for obtaining the date: the day before yesterday, yesterday, today, tomorrow, the day after tomorrow, and the day after tomorrow: Method 1: Copy to ClipboardReference: [] js acquisition date: the day before yesterday,

Display panoramio images on the map using GControl and GLayer objects

Today is a Google map api tutorial on using GControl and GLayer objects to display panoramio images on a map, yesterday I wrote a Google map api tutorial about adding a control button to a Map (Google map API Tutorial: adding a control button to a

A brief analysis from a js exam to the = Operator

In a test set compiled by cssrain, there is such a question: Run code box If the page cannot be displayed, press Ctrl + F5 to refresh the page. For more webpage code: Tip: the code can be modified before running! In

A simple AJAX implementation (hello ajax)

Client: Hello AJAX-Liehuo. Net Onclick = "ajaxSendRequest ('HTTP: // localhost: 8080/test/hello. jsp ')">Server (hello. jsp) hellp-Liehuo. Net Out. println ("hello ajax ");%>

Comparison of JavaScript frameworks-event processing (V)

Event Processing Each JavaScript framework implements cross-browser event processing, and encourages you to use a streamlined linear method instead of the old inline appending event. Take a look at the jQuery example in Listing 6 and use the hover

Onmousewheel event in Javascript

I believe that when you browse Google Map, you will notice that you can scroll up or down the mouse to zoom in or out the Map. In fact, we are no stranger to mouse scrolling. However, to bind a mouse scroll event to an element, we need to have a

How can JavaScript be overloaded?

Functions in ECMAScript cannot be overloaded. However, two functions can be defined in the same scope with the same name without causing an error. However, the last function is actually used. Copy to ClipboardReference: [] function

Compatibility issues and solutions for multiple browsers in Javascript

I. document. formName. item ("itemName ")Problem description: in IE, you can use document. formName. item ("itemName") or document. formName. elements ["elementName"]; In Firefox, only document. formName. elements ["elementName"].Solution: Use

JavaScript: Use document. createDocumentFragment to optimize performance

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

Javascript attributes: addEvent () Usage Analysis

Web applications often use Javascript to process some things on the page. We don't need to talk about form verification. We need to deal with the DOM tree of the page when displaying/hiding or executing a js function based on the user's usage. Take

Summary of 23 JavaScript Study Notes

1. javascript prototype: prototype requires a constructor to define object members when implementing object-oriented (such as defining a class, methods are attached to the prototype of the constructor. 2. In javascript, prototype of the subclass

The JavaScript control layer is always in the center of the webpage

In the Tutorial at (, someone asked the Technical Group whether a layer can always be in the middle of the webpage. Whether the window is enlarged or reduced, the answer is yes, the example code is as follows: helper house

Total Pages: 473 1 .... 457 458 459 460 461 .... 473 Go to: GO

Alibaba Cloud 10 Year Anniversary

With You, We are Shaping a Digital World, 2009-2019

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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: and provide relevant evidence. A staff member will contact you within 5 working days.