JS Tools-js Common methods, JS commonly used to judge methods
SUMMARY:
Copy Code code as follows:
function obj$ (ID) Get object based on ID
function val$ (ID) Gets the value of an object based on the ID
function Trim (str) remove left
Copy Code code as follows:
Copy Code code as follows:
Query
area
Jiang ' an
Jianghan District
Qiaokou District
Dongxihu District
Hanyang District
Wuhan jing Kai
Wuchang District
The first one:
Copy Code code as follows:
function Checkreg ()
{
Verify the phone number of the phone number, including section 153,159
if (document.form.phone.value== "" && document.form.usermobile.value== "") {
Alert ("Phone number
The data that is dynamically output on the page, this is the data that Ajax obtains I want to show on the page
Copy Code code as follows:
Success:function (data) {
var arr = Data.split ('_');
var Numarr = Arr[0].split (",");
var
In most people's eyes, the technical curtilage gives the impression that the person is taciturn, always can not penetrate what he thought in mind, keep each other distance. As half of the programmers, I think the real technical house most of the
1. When you enter a point in the Select Input box, the option to find the options that match the content is displayed in the option's previous options.
2. How to get the content of each input and trigger the function when KeyUp.
Question: Can I
Copy Code code as follows:
How to export a web page to an Excel document
How a Web page is exported as an Excel document
Column Heading 1
Column Heading 2
Column Heading 3
Column Heading 4
Because the project needs! Need script to judge size and file type on client! I find information on the Internet to find a good hard work! Simply write yourself a and test file upload size limit An example, compatible with IE6,IE7,IE8, Google Chrome,
But limited by the browser, in many cases we can only give a link, let the user click Open-"Save As." This link is as follows:
Copy Code code as follows:
file.js
When the user clicks on the link, the browser opens and
Microblogging or forum on the common effect, the choice of expression inserted into the Text field, the display is similar to [haha] such a string, the following is the expression string into a picture of the expression of a way
Copy Code code
Text boxes, radio buttons, check boxes, related actions
Copy Code code as follows:
var sex=$ ("Input[name= ' Sex ']:checked"). Val (); Gets the value of a set of radio selected items
var item=$ ("#sel option:selected"). Text (); Gets the
The IFRAME child page communicates with the parent page depending on whether the SRC attribute in the IFRAME is linked by domain or cross-domain, and the mode of communication is different.
I. Communication of parent-child pages under the same
If the following question is implemented under different conditions (add_step changes), the add_level result values are different:
Copy Code code as follows:
var add_level = 0;
if (Add_step = = 5) {
Add_level = 1;
}
else if
HTML () method
This method is similar to the innerHTML property in JavaScript, and can be used to read or set HTML content in an element. To get the contents of an element, you can do this:
Copy Code code as follows:
var p_html = $
Web page on the right hover QQ online customer service Code
Copy Code code as follows:
function MyEvent (OBJ,EV,FN) {
if (obj.attachevent) {
Obj.attachevent (' on ' +ev,fn);
}else{
Obj.addeventlistener (Ev,fn,false);
};
};
JS weak type makes people feel a lot of things are more confused, for example, if a variable is true or false in the IF condition, type conversion is required if a non-Boolean variable in a strongly typed language is placed in the IF condition, but
HTML () method
This method is similar to the innerHTML property in JavaScript, and can be used to read or set HTML content in an element. To get the contents of an element, you can do this:
var p_html = $ ("P"). html (); Get the HTML code
New Array ()
New Array (len)
New Array ([item0,[item1,[item2,...]]]
Methods for using Array objects:
var objarray=new Array ();
Objarray.concact ([item1[,item2[,....]]] -------------------The argument list is connected to the back of the Objarray to
In front-end development work, it is often necessary to escape the left and right angle brackets of HTML into solid form. We can not put ,& and so on directly in the final view of the page. It needs to be escaped before it can be displayed on the
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