JavaScript uses call to invoke micro-api_javascript techniques

Source: Internet
Author: User

Code is very simple, just give everyone a train of thought, here is not much nonsense, the source code:

Copy Code code as follows:

<! DOCTYPE html>
<title> micro-letter 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,inital-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>
<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 substitution, for methods
C1.aaa.call (C2);//error, only method inheritance, property not supported
-->
</script>

</body>

Here is just the introduction of ideas to everyone, the specific small partners free play it.

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.