惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Proofpoint News Feed
C
CERT Recently Published Vulnerability Notes
O
OpenAI News
V
Vulnerabilities – Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
S
Schneier on Security
Latest news
Latest news
F
Full Disclosure
T
Tenable Blog
T
Troy Hunt's Blog
The Last Watchdog
The Last Watchdog
S
Secure Thoughts
L
LangChain Blog
有赞技术团队
有赞技术团队
Project Zero
Project Zero
Cloudbric
Cloudbric
爱范儿
爱范儿
GbyAI
GbyAI
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
The Exploit Database - CXSecurity.com
S
Security @ Cisco Blogs
Hugging Face - Blog
Hugging Face - Blog
Recorded Future
Recorded Future
大猫的无限游戏
大猫的无限游戏
Last Week in AI
Last Week in AI
C
Cisco Blogs
WordPress大学
WordPress大学
Apple Machine Learning Research
Apple Machine Learning Research
小众软件
小众软件
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V2EX - 技术
V2EX - 技术
Engineering at Meta
Engineering at Meta
Spread Privacy
Spread Privacy
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Hacker News: Ask HN
Hacker News: Ask HN
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Schneier on Security
Schneier on Security
T
Threat Research - Cisco Blogs
M
MIT News - Artificial intelligence
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
K
Kaspersky official blog
The Hacker News
The Hacker News
V
V2EX
F
Fortinet All Blogs
L
LINUX DO - 最新话题
Cisco Talos Blog
Cisco Talos Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
N
News | PayPal Newsroom
博客园 - 三生石上(FineUI控件)
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org

博客园 - 辰

【破解】webix 9.1.6 试用版 弹窗提示破解教程 【经验】微信小程序 canvas 图片拉伸 对 wx.canvasToTempFilePath 截图导出的影响。 【经验】微信小程序Canvas 的画图尺寸学习研究。 [入门到吐槽系列] 微信小程序 上传图片 前端压缩 保存到云存储 使用Canvas新API的巨坑! [入门到吐槽系列] 微信小程序 敏感违规图片检测 mediaCheckAsync,客服接口 消息推送 的各种坑分享! [突发救援] 网站突发被腾讯云因未备案 屏蔽,60分钟内抢救恢复成功! [入门到吐槽系列] Webix 10分钟入门 二 表单Form的使用 [入门到吐槽系列] Webix 10分钟入门 一 管理后台制作 租了一台华为云耀云服务器,却直接被封公网ip,而且是官方的bug导致! 从事游戏行业也有10年,让我来说下游戏的本质,为什么上瘾。 Egret 生成 自带EUI 的微信小游戏 踩坑! JMeter入门 像屎一样的 Spring Boot入门,总算有反应了 亲测有效!一种完美动态阈值白平衡算法 Java实现。 Windows 2008 - 由于管理员设置的策略,该磁盘处于脱机状态 egret GUI 和 egret Wing 是我看到h5 最渣的设计 Egret 集成第三方库 记录 乐高情报站7月份抽奖数据汇总。 今天是第二个最值得纪念的日子。
egret调用页面js的方法。
· 2015-08-07 · via 博客园 - 辰

参考文献:

http://bbs.egret-labs.org/thread-267-3-1.html

http://docs.egret-labs.org/post/manual/threelibs/uselibs.html

假设我的项目在c:\egret\demo

1. 项目发布后,有一个index.html,添加一段js:

<script type="text/javascript">
// http://bbs.egret-labs.org/forum.php?mod=viewthread&tid=267&highlight=js
// http://docs.egret-labs.org/post/manual/threelibs/uselibs.html
function __statistics__(category,action,label,value) {
_czc.push(["_trackEvent",category,action,label,value,'']);
}
</script>

2. 在项目里面调用这个js:

__statistics__('FRAMEWORK.BOTTOM', 'CLICK', '', '');

3. 这个时候如果编译,会提示找不到方法。那么,在项目新建一个mylibs目录。

4. 新建一个me.d.ts:

declare function __statistics__(category:string,action:string,label:string,value:string): void;

5. 新建一个bendmark.json

{
"name": "benchmark",
"dependence": ["core"],
"source":"",
"file_list": [
"me.d.ts"
]
}

6. 修改egretProperties.json,modules下添加:


{
"name":"benchmark",
"path":"/mylibs/"
}

既:

{
    "document_class": "Main",
    "modules": [
        {
            "name": "core"
        },
        {
            "name": "version_old"
        },
        {
            "name": "res"
        },
        {
            "name": "gui"
        },
        {
            "name":"benchmark", 
            "path":"/mylibs/"
        }
    ],
    "native": {
        "path_ignore": []
    },
    "egret_version": "2.0.2"
}

7. egret build -e -clean 就可以看到编译成功了。多么的傻逼啊!