Php uploads an image and adds a transparent watermark to the image. For more information, see.
The Code is as follows:
$ Im = imagecreatefromjpeg ($ _ file ["upload"] ["tmp_name"]); // the image of the example you want to fetch water$ Watermark
Since the rise of AJAX, javascript programs have become increasingly large, and various tests have to be considered. In the past, javascript was weak in IO support, so it could not be written into the corresponding text file, and the Error of the
JavaScript obtains the browser type and page encoding function code. Obtain the page encoding. for IE browser, use document. charset. For firefox, use
Document. characterSet.
The Code is as follows:
Function getPageCharset (){Var charSet =
I need to use TomBox in the jQuery component at work today, but I found that the previous Tombox failed. I checked the TomBox. js code in it and I didn't see it.
Later, the manager reminded me that the selector syntax problem may be caused by the
In JavaScript, replace is used to achieve the effect of replaceAll. In fact, it is replaced globally with a regular expression. Method:
String. replace (new RegExp (oldString, "gm"), newString ))
Gm stands:
G = global, m = multiLine
In general,
CreateAdder (x) is a function that returns a function. In JavaScript, functions are the first type of objects. In addition, they can be passed to other functions as parameters and functions. In this case, the function return itself is a function
This article is very helpful to my friends who have just started to learn about js. The main knowledge points have been sorted out.
1. Create a script block
Program code
The Code is as follows:
Some common Javascript detection functions are extended over prototype. // Function Name: trim
// Function Description: removes spaces at the beginning and end of a string.
// Creation Date:
// Last Modify By: N/
// Last Modify Date: N/
String.
The implementation code of asp does not repeat the array data, which is finer and stronger than the previous version. You can choose as needed. Function Code:
The Code is as follows:
'Filtering array repeated function name: array_no (cxstr1,
JQuery obtains the object positioning sub-object. For more information about how to locate sub-objects, see. Special characters selected:
# Id
. Indicates class
* Select all
, Select multiple
Space descendant
> Sub-
~ Brother
+ Next
: Sub-function)
The parent form of a javascript subform uses the window. open function to pass values to each other. The following code is provided by the script. The script is a simplified version. In general, many cms have such functions. This function is also
JQuery obtains the basic selection and hierarchical implementation code of objects. For more information about jquery, see. Select by id (only one object can be selected by id), for example: $ ("# p2 ")
AAA
BBB
CCC
Select by TAG, for example,
Summary of common JS type conversion methods. For more information, see.
I. type conversion
1. Convert to string
ECMAScript's Boolean values, numbers, and string values are interesting because they are pseudo objects, which means they actually have
Because the customer needs to differentiate the full angle and the half angle, some minor changes have been made to the jquery. inputlimiter. js plug-in. See:
Source code:
The Code is as follows:
Input Limiter Demo
To be honest, I am a person who prefers to doubt the authority, but I have been flashing in front of me for some authority issues, so I began to doubt them, because 10000 people say this is correct, I think it is true. Then let's see which authority
Avoid the Cause Analysis of the new form displayed in showModalDialog. Generally, you need to use window. open. showModalDialog and showModelessDialog to return the value.
1. What are the differences between showModalDialog and
Upload the text value to textarea because manual income is prone to errors. This function is generally used to add multiple download server addresses. dedecms also uses this method. Effect:
Script function Addother () {if (document. form1.ourl.
Recently, a large number of events need to be added, and all events need to be carefully controlled, so I tried to write an event listener. The Code is as follows:
The Code is as follows:
Var br = {};Br. eventRouter = {};Br. eventRouter.
In my opinion, the best method is to use regular expressions. This is the core principle, because there are multiple forms of spaces.
Method 1: Regular Expression replacement recommendation
In my opinion, the best method is to use regular
It should have been the second chapter, interface, but because the closure really does not understand, so first look at the closure body
The concept of closure:
A closure is an expression (usually a function) that has many variables and is bound
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