![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
html5 javascript
韩初心
前端搬砖扛锅
展开
-
js 协程使用示例
{ // 协程测试 var FuncEmpty = function () { function Wait(co, time) { setTimeout(function () { co.next(); }, time); } function* TestFun(coInfo) { var co = coInfo.co; c...原创 2021-10-14 23:45:40 · 430 阅读 · 0 评论 -
Webstorm JavaScript 注解的写法收集
资料来源为https://jsdoc.app/tags-type.html类的注解,举例/*** @class* @name GameClient.Game_Monster* @extends GameClient.Game_Entity* @property {cc.Node} m_displayNodeRef* @property {Object} m_unitA...原创 2019-11-16 15:37:38 · 463 阅读 · 0 评论 -
输出的数字字符串补 0
可以扩展到补充其他字符串的情况{ // 输出的数字字符串补 0 var strIndex = ""; var strZero = "000"; strIndex = "" + 21; strIndex = strZero.substring(0, 3 - strIndex.length) + strIndex; // 3 位数,不全补 0}原创 2016-12-25 12:42:46 · 491 阅读 · 0 评论 -
websocket html5 客户端测试代码
测试 websocket 客户端的连接、发送消息和断开,生成一个面板用于显示 log,代码功能单一,便于测试。index.html WebSoket Demo // tips: WebSocket 调试脚本 var WebSocket = WebSocket || window.WebSocket原创 2016-12-13 23:08:51 · 3571 阅读 · 0 评论 -
JavaScript table 序列化
// 序列化一张表var MySerialize = function (obj) { //return JSON.stringify(obj, null, 4); { // 写完这个函数才发现 JSON.stringify(obj, null, 4) 就能转,蛋疼 if (typeof(obj) != "object" || obj == null)原创 2017-07-10 17:31:18 · 1927 阅读 · 0 评论