坏小仔

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年8月22日

摘要: 1 <script type="text/javascript"> 2 function globalEval(data) { 3 data = data.replace(/^\s*|\s*$/g, ""); 4 if (data) { 5 var head = document.getElementsByTagName("head")[0] || 6 document.documentElement, 7 8 script = document.createElement("script"); 9 s 阅读全文
posted @ 2012-08-22 17:17 坏小仔 阅读(141) 评论(0) 推荐(0) 编辑

摘要: Another way that we can cause strings of code to be evaluated, and in this caseasynchronously, is through the user of timers.Normally, as we saw in chapter 8, we’d pass an inline function or a function reference toa timer. This is the recommended usage of the setTimeout() and setInterval()methods, B 阅读全文
posted @ 2012-08-22 17:03 坏小仔 阅读(93) 评论(0) 推荐(0) 编辑

摘要: All functions in JavaScript are an instance of Function.; we learned that back in chapter 3.There we saw how we could create named functions using syntax such as functionname(...){...}, or omit the name to create anonymous functions.However, we can also instantiate functions directly using the Funct 阅读全文
posted @ 2012-08-22 17:00 坏小仔 阅读(105) 评论(0) 推荐(0) 编辑

摘要: The eval() method will return the result of the last expression in the passed code string.For example, if we were to call:eval('3+4;5+6')the result would be 11.It should be noted that anything that isn't a simple variable, primitive, or assignment willactually need to be wrapped in a par 阅读全文
posted @ 2012-08-22 16:57 坏小仔 阅读(154) 评论(0) 推荐(0) 编辑