Yesterday, we needed to customize the ckeditor editor toolbar and add a plug-in as a requirement. Next I will introduce my recording notes to you, so you can learn it as needed.
1. Download and install ckeditor.
2. Custom toolbar buttons:
You can
This article summarizes the usage of addEventListener () and removeEventListener (). For more information, see.
AddEventListener () and removeEventListener () are used to process specified and deleted event handlers. All DOM nodes contain these two
In js, the algorithm for retrieving the position of an element on the page is very simple, as long as it is the position of the element on the page = the position of the element relative to the browser window + the value of the browser scroll bar,
Today, I saw some common mouse events on a friend's website. Below I will sort out and keep a record, which will be useful in the future. If you need to know about it, you can refer to it.
General eventsDescription supported by event Browser
OnClick
This article recommends a good floating page advertisement to all of you. The Calling method is simple. You only need to create a div on the page and specify the id, then you can use js var ad1 = new AdMove ('gg1'); ad1.Run.
The Code is as
1. special characters in brackets [] do not need to be escaped, such as [/], [.], [*], and [?]. And [+] can directly match the corresponding characters .*? +. The test result is as follows:
Therefore, the/[d.]/regular expression matches a number
This article introduces how to compare the efficiency of JavaScript arrays and Object objects for loops. for more information, see
In the past, xiaohang sub (mountain) told me that the multi-purpose object uses fewer array objects, because the
This article describes how to obtain FCK editor information/value assignment in js. For more information, see references.
Editor Information
The Code is as follows:
Copy code
Function getEditorContents (){Var oEditor =
Below I have summarized various methods to delete spaces, including deleting spaces before and after deletion, intermediate spaces, and continuous spaces. For more information, see.
Method 1:
In my opinion, the best method is to use regular
In js, spaces and spaces are two different types of conditions. Spaces occupy one character space. Many programmers can directly submit a space if they enter a few spaces during judgment, to filter spaces in js, we only need to use replace for
Before jquery appeared, we had to use XMLHttpRequest to Create ajax before creating ajax. Next I will take out the ajax I wrote many years ago.
XMLHttpRequest
The Code is as follows:
Copy code
Next let's take a look
When limiting the number input by users in js, our core code is to add the onKeyDown event in testarea, and then write a character judgment function to judge the field. value. the length is greater than the character length we set. If yes, substring
In javascript, we need to obtain the coordinates of the mouse position in several ways. One is the relative position (browser window, document location). Almost all of these are using document. body. scrollTop, document. body. dom commands such as
In js, there is no such thing as php that can be used directly to sort data randomly. Here we will write a custom random array sorting function.
There are many ways to randomly arrange javascript arrays. The following is a simple method:
This article will introduce you to the program for redirecting to the specified element. This is a good transfer program. If you need to know about it, you will not be able to access it.
The Code is as follows:
Copy code
/***
In js, if we want to encode the url, the commonly used functions include escape, encodeURI, and encodeURIComponent. The corresponding three decoding functions are: unscape, decodeURI, and decodeURIComponent, next we will introduce the conversion
Here we will introduce the regular assignment of values to the specified div. We can use the setInterval or setTimeOut Function to execute the ajax function, so that we can refresh the function in a few seconds, let's look at the instance.
Example
This article provides some detailed descriptions and examples of the inheritance and usage of non-function objects in Javascript. There are two types of Javascript inheritance. One is inheritance based on \ "function object \", that is, a function
This article introduces two good implementation programs for returning to the top by using jq and javascript. For more information, see.
The jquery blog is now out of work on time. Recently, I am very tired. It is estimated that I have worked
The simplest way to copy content in js is to directly use createTextRange () and execCommand () and then there are window. clipboardData. setData and so on. Next I will summarize various application instances.
Example 1
The Code is 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.