文章分类 - javascript
摘要:javascript函数默认参数的写法<pre>function example(name,age){ name=name||'貂蝉'; age=age||21; alert('你好!我是'+name+',今年'+age+'岁。'); } </pre>
阅读全文
摘要:javascript微信ios自动播放音效方法<pre> wx.config({ //debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 appId: $('#appI
阅读全文
摘要:javascript eval动态变量的方法<pre>var dd = 'fe';var ss = "cc('" + dd + "')";//先确认要运行的alert(ss);eval(ss); function cc(dd) { alert(dd); return false} </pre><pr
阅读全文
摘要:javascript tofixed四舍五入的方法 <pre>Number.prototype.toFixed = function(d) { var s = this + ""; if (!d) d = 0; if (s.indexOf(".") == -1) s += "."; s += new
阅读全文
摘要:<pre>defined('APP_PATH') || define('APP_PATH', 'wafawfew');</pre> 返回值只有返回真和假 他支持运行代码 但js就不一样 他支持返回值。。 也支持运行代码<pre> var a= 2||3;alert(a);</pre> 返回的就是2
阅读全文