Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Function block (function)

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Mobile Phone >

Share

Shulou(Shulou.com)05/31 Report--

Hello everyone, Lin Fei to answer the above questions for you, function block,function many people do not know, now let's take a look at it!

How do I use the function function? This paper mainly introduces several methods of defining functions in JSfunction. Friends in need can refer to the four methods of defining functions in JSfunction.

The 1.function function is basically used as a function declaration for a notebook.

The following code is 3360.

Functionfunc () {} or Val func=function () {}

The 2.function function is used as a class constructor

The following code is 3360.

The 3.function function is used as a closure:

The following code is 3360.

The 4.function function can be used as a selector:

The following code is 3360.

The mixed application of 5.function function in four cases:

The following code is 3360.

6. Use the function function to process the js script returned by ajax:

The way to construct the function: varfunc=newfunction (args1,args2,args3,body) args: parameter (any number); Body: functional body. For example:

Var func=newFunction ('arg1', 'arg2', 'alert (arg1': 'arg2)'); func ('ooo', 'PPP')

It is important to note the format of the return code. According to the processing principle, the return form can be:

1.function () {/ / code}) ()

2. {avut 'ABC', func: function {}} / / Hash table

3. Function () {}

The above three should handle most of the code.

At the end of this article, I hope it will be helpful to you.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Mobile Phone

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report