Some summary in development...

Source: Internet
Author: User

When using the ajaxpro method, you must note that the method on the background page cannot use some built-in encapsulation methods of the foreground page control, such.
Id. Text... when using these methods, you can only pass the Parameter

About wrap in. there is no pop-up box in the netweb page. We usually use alert to implement it. The content in alert sometimes requires line breaks. At this time, we should never use \ n to complete the process, use \ n...

Record the page stay time
Pageopen = new date ();
Function stay (){
Pageclose = new date ();
Minutes = (pageclose. getminutes ()-pageopen. getminutes ());
Seconds = (pageclose. getseconds ()-pageopen. getseconds ());
Time = (seconds + (minutes * 60 ));

 

Trim () in JS ()

By default, JS does not have the trim () attribute. If you want to use it, you have to add it yourself.

The method format for writing a class is as follows: (Str. Trim ();)

<Script language = "JavaScript">
String. Prototype. Trim = function (){
Return this. Replace (/(^ \ s *) | (\ s * $)/g ,"");
}
String. Prototype. ltrim = function (){
Return this. Replace (/(^ \ s *)/g ,"");
}
String. Prototype. rtrim = function (){
Return this. Replace (/(\ s * $)/g ,"");
}
</SCRIPT>
You can write a function as follows: (TRIM (STR ))
<SCRIPT type = "text/JavaScript">
Function trim (STR) {// Delete spaces between the left and right sides
Return Str. Replace (/(^ \ s *) | (\ s * $)/g ,"");
}
Function ltrim (STR) {// Delete the left space
Return Str. Replace (/(^ \ s *)/g ,"");
}
Function rtrim (STR) {// Delete the right space
Return Str. Replace (/(\ s * $)/g ,"");
}
</SCRIPT>

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.