Javascript uses call to call API, callapi
The code is very simple. I just want to give you a thought. There is not much nonsense here. Here is the source code:
Copy codeThe Code is as follows:
<! DOCTYPE html>
<Html>
<Head>
<Title> Js API Demo </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8">
<Link rel = "dns-prefetch" href = "http://mmbiz.qpic.cn">
<Link rel = "dns-prefetch" href = "http://res.wx.qq.com">
<Meta name = "viewport" content = "width = device-width, height = device-height, inner-scale = 1.0;">
<Meta name = "apple-mobile-web-app-capable" content = "yes">
<Meta name = "apple-mobile-web-app-status-bar-style" content = "black">
<Meta name = "format-detection" content = "telephone = no">
<Style type = "text/css">
P {
Padding: 5px 10px;
}
</Style>
<Script type = "text/javascript" src = "WeixinApi. js? V = 1 "> </script>
</Head>
<Body>
<Script language = "javascript">
<! --
Function Class1 (){
This. name = "class1 ";
This. aaa = "aaa ";
This. showNam = function (){
Alert (this. name );
}
}
Function Class2 (){
This. name = "class2 ";
}
Var c1 = new Class1 ();
Var c2 = new Class2 ();
// C1.showNam ();
C1.showNam. call (c2); // object replacement, for methods
C1.aaa. call (c2); // error. It can only be inherited from methods, and attributes are not supported.
-->
</Script>
</Body>
</Html>
Here is just an introduction to the idea. Let's take full advantage of the specific friends.