JS Init:function ()

Source: Internet
Author: User







In this case, you can use A.init () to call this function,

<Scripttype= "Text/javascript">    varobj={init:function(str) {alert ("init call:"+str); }, Exit:function(str) {alert ("Exit Call:"+str);    }    }; varInit=Obj.init ('Init'); varExit=Obj.exit ('Exit');</Script>

Overall, it is the initialization of the entire page.

In a little more detail, this is the style of writing that has been popular in recent years, with all function, all variables, and so on, using the var o = {x:func, y: "", z:obj} to write the notation.

It can be understood in a class-like way, and the execution efficiency is relatively high.
 

JS Init:function ()

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.