/*
Determines whether the specified content is null. If it is null, a warning box is displayed.
*/
Function isEmpty (theValue, strMsg ){
If (theValue = ""){
Alert (strMsg + "cannot be blank! ");
Return true;
}
Return false;
}
/*
Chinese judgment
AvaScript is now the most popular language. It can do many things-website interfaces, server terminals, games, operating systems, robots, and many more. But to be honest, even if JavaScript is so crazy, it is already the most popular language. It
Copy codeThe Code is as follows :/**
2 * retrieve array elements (prototype extension or overload)
3 * @ param {o} The retrieved element value
4 * @ type int
5 * @ returns element index
6 */
7 Array. prototype. contains = function (o ){
8 var index =
String. prototype. The parameters of the split method support strings and regular expressions ~ 8 (lower IE versions may also have errors, so I won't test it). The results of split-out arrays are different from those of W3C-compliant browsers.Script:
From the worry-free script collected, some really good, more practical, worth collecting.
methods to extend the prototype object of an array
Copy Code code as follows:
Delete data in an array
Array.prototype.del = function (n)
{
if
JS Extension Method Instance Analysis
The JS extension method is very similar to the C # extension method and can also be called in a chain. It is also implemented through the extension of a class. This is very useful. If you put the pre-written
Copy codeThe Code is as follows:// Static method of String objectObject. extend (String ,{Interpret: function (value ){Return value = null? '': String (value );},SpecialChar :{'\ B': '\ B ','\ T':' \ t ','\ N':' \ n ','\ F':' \ F ','\ R':' \ R ','\\'
Example of using string trim () in JS, jstrim
Example 1:
test JS Extension Method
Example 2:
// Clear the space String on both sides. prototype. trim = function () {return this. replace (/(^ \ s *) | (\ s * $)/g, '') ;}; // Merge multiple
JS Extension Method Instance analysis and js extension instance analysis
This article describes how to implement JS extension methods. Share it with you for your reference. The specific analysis is as follows:
The JS extension method is very similar
360 several bypass positions monitored by X-SS
360 the browser guard is based on the javascript hook mechanism to implement front-end xss protection. The product is very good and the performance is also good, but there are still some
To solve this problem, I wrote a function that intercepts strings based on the number of bytes yesterday.It is easy to use, just like String. subString (start, end. For example, var str = "cailove"; var str1 = str. subCHStr (2, 2); var str2 = str.
I should be tired after the night package, but I still have the strength to beat these characters. It seems that I have not reached this point yet.To put it bluntly, I recently wrote an online editor, which is similar to ewebeditor. Of course, it is
InstallShield: some functions used to write XML and ini configuration filesSome functions of InstallShield for writing XML and ini configuration files
InstallShield uses the DOM Document Object Model for operating XML, which is
Prototype is an API written in Javascript, including the expansion of JavaScript classes such as string and array. You can embed Javascript files and use them directly.
CopyCode The Code is as follows: String. Prototype. strlen = function (){
VaR
Document directory
String. Prototype. Format
Date. Prototype. Format
Function. Prototype. Delegate
Bunker!
You must declare in advance that I do not agree with the method of intruding JavaScript Object prototypes. However, the reason for
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.