Tip: You can modify some of the code before running
JavaScript very personalized Picture Show magnification display effect very personalized picture display effect (10) and
Between--> and --> & lt;/span> &L T;span >
The use of regular
The code is as follows
Copy Code
To take the zodiac, the parameters must be four-digit yearsfunction Getshengxiao (yyyy) {var arr=[' monkey ', ' chicken ', ' dog ', ' pig ', ' rat ', ' ox ', ' tiger ',
Introduction to Strings
Enclosed in English single or double quotes, such as: ' Hello ', ' world ', but not the single and double quotes must be consistent, staggered, if you want to print single quotes or double quotes, you can use the escape
Recently too Busy, originally a weekly article, one months also did not write an article. Hey!Next, the intention of the blog to make a revision, may change the blog address, good earnest writing articles, the future of the blog content will be
First, the original ecological JS set the text box value
Get the value of test
var t=document.getelementbyidx_x ("Test"). Value assigns values to variable t
Give Assign Value
document.getelementbyidx_x ("Test"). Value = ' www.111cn.net ';
The following methods are commonly used for converting such data to Chinese problems.
The code is as follows
Copy Code
1. Eval resolution or New Function ("' + str + ')" ()str = eval ("'" + str + ""); "I'm a Unicode code.
When you want to show more information in a limited space, we often take the mouse to slide over the pop-up more relevant information layer to improve interactivity. Especially can be applied in the company photo wall, recruitment site job seekers
Whether the variable is empty
The following is the result of the IF (TMP) {} decision:
The code is as follows
Copy Code
if (TMP) if (tmp!=null)//false//false when TMP is
Principle
is divided into two steps: when the upload image input is triggered and select a local image to upload the image of the object URL (object URL); Assign the object URL to the pre-written img tag src attribute can display the picture.
Here
Example
The code is as follows
Copy Code
Date.prototype.format = function (format){var o = {"m+": This.getmonth () +1,//month"D+": This.getdate (),//day"h+": this.gethours (),//hour"m+": This.getminutes (),//minute"S+":
The core is the regular
The code is as follows
Copy Code
var url = location.href;Gets the parameter value of the keywordvar es=/keyword=/;Es.exec (URL);var Result=regexp.rightcontext;
For example:
Web communications, a particularly large topic, the cover is also very wide. Because I recently learned some of the web communication knowledge in JavaScript, here's a summary. There should be some understanding of the wrong or unclear expression of
This is the first time I understand the concepts of JavaScript asynchronous, single-threaded, queue, thanks to Async JavaScript.Asynchronous timer function
First, from the asynchronous timing function SetTimeout:
The code is as follows
* Trim: Remove both sides of the space LTrim: Remove the left space RTrim: remove the right spaceUsage* var str = "Hello";* str = Str.trim ();*/
String.prototype.trim = function ()
{
Return This.replace (/(^[s]*) | ( [s]*$)/g, "");
}
1. The implementation of JavaScript regular expressions
JavaScript support for regular expressions is implemented through the RegExp class in ECMAScript, where the constructor of the RegExp object can take one or two parameters. The first parameter
JavaScript Tutorial User Name VerificationThe following check function if the user enters any user name in all fields. If it is not empty, we check the length of the string and allow a unique username of 5 to 15 characters. Next, we use JavaScript
XML and JavaScript instances
Brief introduction:
Browser problem:
When it comes to browser-incompatible client language is a major problem. But here we have to use XML and Javascript,xml is the problem. Not all browsers have support for parsing
(function () {var isready=false;//to determine if the Ondomready method has been executedvar readylist= [];//The method that needs to be executed is in this array first.var timer;//timer handleReady=function (FN) {if (IsReady)Fn.call
Tip: you can modify some code before running The mobaihuo website is provided free of charge at the backend of _ www.111cn.net. The mobaihuo website is provided free of charge in the background.
Tip: you can modify some code before running Simple and practical tab menu与之间-->与之间-->News 1Sports 1Finance 1News 1Sports 1 contentFinance 1 contentNews 2Sports 2Finance 2News 2 contentSports 2 contentFinance 2 content Tip: you can modify some
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.