الكود بسيط للغاية ، فقط لإعطائك فكرة. لن أتحدث كثيرًا هنا ، فقط قدم رمز المصدر:
نسخة الكود كما يلي:
<! doctype html>
<html>
<head>
<title> WeChat 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 = width device ، height = device-height ، inital-scale = 1.0 ؛">
<meta name = "Apple-Mobile-Web-App-Conference Content =" Yes ">
<meta name = "Apple-Mobile-Web-App-Status-Bar-style" content = "Black">
<meta name = "format-detection" content = "telephone = no">
<type type = "text/css">
ص {
الحشو: 5px 10px ؛
}
</style>
<script type = "text/javaScript" src = "weixinapi.js؟ v = 1"> </script>
</head>
<body>
<script language = "javaScript">
<!-
وظيفة class1 () {
this.name = "class1" ؛
this.aaa = "aaa" ؛
this.shownam = function () {
تنبيه (this.name) ؛
}
}
وظيفة class2 () {
this.name = "class2" ؛
}
var c1 = جديد class1 () ؛
var c2 = جديد class2 () ؛
//c1.shownam () ؛
c1.shownam.call (c2) ؛ // الكائن التقليب ، للطريقة
C1.AAA.Call (C2) ؛ // خطأ ، فقط لميراث الطريقة ، لا يتم دعم السمات
->
</script>
</body>
</html>
أنا هنا فقط أقدم الأفكار للجميع ، حتى تتمكن من اللعب بأفكارك المحددة بحرية.